.
Some checks failed
Build & Release / build-latest (push) Failing after 4m57s
Build & Release / version-release (push) Has been skipped

This commit is contained in:
Salastil
2025-11-16 15:49:42 -05:00
parent f23afebeaa
commit 254db39268

View File

@@ -25,9 +25,11 @@ jobs:
- name: Delete Previous Latest Release
continue-on-error: true
env:
GITEA_TOKEN: ${{ secrets.CI_TOKEN }}
run: |
curl -X DELETE \
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \
-H "Authorization: token ${GITEA_TOKEN}" \
"https://git.salastil.com/api/v1/repos/Salastil/Sneedchat-Discord-Bridge-Go/releases/tags/latest"
- name: Delete Latest Tag
@@ -43,12 +45,20 @@ jobs:
git push origin latest
- name: Create Latest Release and Upload Binary
env:
GITEA_TOKEN: ${{ secrets.CI_TOKEN }}
run: |
set -x
# Verify token exists
if [ -z "$GITEA_TOKEN" ]; then
echo "ERROR: CI_TOKEN secret is not set!"
exit 1
fi
# Create release
RESPONSE=$(curl -X POST \
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "latest",
@@ -61,7 +71,7 @@ jobs:
echo "Create release response: $RESPONSE"
# Extract release ID using grep and sed (no jq dependency)
# Extract release ID
RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*')
echo "Release ID: $RELEASE_ID"
@@ -72,13 +82,11 @@ jobs:
fi
# Upload binary
UPLOAD_RESPONSE=$(curl -X POST \
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \
curl -X POST \
-H "Authorization: token ${GITEA_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")
echo "Upload response: $UPLOAD_RESPONSE"
"https://git.salastil.com/api/v1/repos/Salastil/Sneedchat-Discord-Bridge-Go/releases/$RELEASE_ID/assets?name=Sneedchat-Discord-Bridge"
version-release:
runs-on: ubuntu-latest
@@ -103,12 +111,20 @@ jobs:
GOOS=darwin GOARCH=arm64 go build -o dist/Sneedchat-Discord-Bridge-darwin-arm64 .
- name: Create Version Release and Upload Binaries
env:
GITEA_TOKEN: ${{ secrets.CI_TOKEN }}
run: |
set -x
# Verify token exists
if [ -z "$GITEA_TOKEN" ]; then
echo "ERROR: CI_TOKEN secret is not set!"
exit 1
fi
# Create release
RESPONSE=$(curl -X POST \
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \
-H "Authorization: token ${GITEA_TOKEN}" \
-H "Content-Type: application/json" \
-d '{
"tag_name": "${{ github.ref_name }}",
@@ -135,10 +151,9 @@ jobs:
for file in dist/*; do
filename=$(basename "$file")
echo "Uploading $filename..."
UPLOAD_RESPONSE=$(curl -X POST \
-H "Authorization: token ${{ secrets.CI_TOKEN }}" \
curl -X POST \
-H "Authorization: token ${GITEA_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")
echo "Upload response for $filename: $UPLOAD_RESPONSE"
"https://git.salastil.com/api/v1/repos/Salastil/Sneedchat-Discord-Bridge-Go/releases/$RELEASE_ID/assets?name=$filename"
done