.
This commit is contained in:
@@ -43,14 +43,31 @@ jobs:
|
|||||||
git push origin latest
|
git push origin latest
|
||||||
|
|
||||||
- name: Create Latest Release
|
- name: Create Latest Release
|
||||||
uses: actions/release-action@v1
|
run: |
|
||||||
with:
|
# Create release using Gitea API
|
||||||
token: ${{ secrets.CI_TOKEN }}
|
RELEASE_DATA=$(cat <<EOF
|
||||||
tag_name: latest
|
{
|
||||||
name: Latest Build (Development)
|
"tag_name": "latest",
|
||||||
body: "Automated build from master branch. This is a development build."
|
"name": "Latest Build (Development)",
|
||||||
prerelease: true
|
"body": "Automated build from master branch commit ${{ github.sha }}",
|
||||||
files: Sneedchat-Discord-Bridge
|
"draft": false,
|
||||||
|
"prerelease": true
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
RELEASE_ID=$(curl -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "$RELEASE_DATA" \
|
||||||
|
"https://git.salastil.com/api/v1/repos/Salastil/Sneedchat-Discord-Bridge-Go/releases" | jq -r '.id')
|
||||||
|
|
||||||
|
# Upload binary to release
|
||||||
|
curl -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
--data-binary @Sneedchat-Discord-Bridge \
|
||||||
|
"https://git.salastil.com/api/v1/repos/Salastil/Sneedchat-Discord-Bridge-Go/releases/$RELEASE_ID/assets?name=Sneedchat-Discord-Bridge"
|
||||||
|
|
||||||
version-release:
|
version-release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -75,7 +92,31 @@ jobs:
|
|||||||
GOOS=darwin GOARCH=arm64 go build -o dist/Sneedchat-Discord-Bridge-darwin-arm64 .
|
GOOS=darwin GOARCH=arm64 go build -o dist/Sneedchat-Discord-Bridge-darwin-arm64 .
|
||||||
|
|
||||||
- name: Create Version Release
|
- name: Create Version Release
|
||||||
uses: actions/release-action@v1
|
run: |
|
||||||
with:
|
# Create release using Gitea API
|
||||||
token: ${{ secrets.CI_TOKEN }}
|
RELEASE_DATA=$(cat <<EOF
|
||||||
files: dist/*
|
{
|
||||||
|
"tag_name": "${{ github.ref_name }}",
|
||||||
|
"name": "Release ${{ github.ref_name }}",
|
||||||
|
"body": "Release ${{ github.ref_name }}",
|
||||||
|
"draft": false,
|
||||||
|
"prerelease": false
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
|
||||||
|
RELEASE_ID=$(curl -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "$RELEASE_DATA" \
|
||||||
|
"https://git.salastil.com/api/v1/repos/Salastil/Sneedchat-Discord-Bridge-Go/releases" | jq -r '.id')
|
||||||
|
|
||||||
|
# Upload all binaries
|
||||||
|
for file in dist/*; do
|
||||||
|
filename=$(basename "$file")
|
||||||
|
curl -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \
|
||||||
|
-H "Content-Type: application/octet-stream" \
|
||||||
|
--data-binary @"$file" \
|
||||||
|
"https://git.salastil.com/api/v1/repos/Salastil/Sneedchat-Discord-Bridge-Go/releases/$RELEASE_ID/assets?name=$filename"
|
||||||
|
done
|
||||||
Reference in New Issue
Block a user