Update .forgejo/workflows/release.yml
Some checks failed
Release / release (push) Failing after 4m0s

This commit is contained in:
root 2025-06-25 13:25:43 +01:00
parent cb96a7c37a
commit ef24c21df4

View file

@ -107,34 +107,33 @@ jobs:
path: target/resilient*.jar
# auto-create a release
- name: Create release and upload JAR to Forgejo
- name: Create release and upload JAR
run: |
# Install Forgejo CLI
echo "Downloading forgejo-linux-amd64 ..."
wget https://codeberg.org/Cyborus/forgejo-cli/releases/download/v0.2.0/forgejo-cli-linux-amd64 -O /usr/local/bin/forgejo
echo "Downloaded forgejo-linux-amd64"
echo "chmod +x /usr/local/bin/forgejo"
chmod +x /usr/local/bin/forgejo
VERSION=${{ steps.version.outputs.release_version }}
API="https://git.oguerreiro.com/api/v1"
REPO="root/resilient"
# Verify binary
echo "Verify binary"
file /usr/local/bin/forgejo # Should say: ELF 64-bit ...
# Create release
RESPONSE=$(curl -s -X POST "$API/repos/$REPO/releases" \
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
-H "Content-Type: application/json" \
-d "{
\"tag_name\": \"v$VERSION\",
\"target_commitish\": \"master\",
\"name\": \"Release v$VERSION\",
\"body\": \"Automated release by CI\"
}")
# Configure Forgejo CLI with token
forgejo config --host https://git.oguerreiro.com --token "${{ secrets.FORGEJO_TOKEN }}"
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
# Extract version
VERSION="${{ steps.version.outputs.release_version }}"
echo "Created release ID: $RELEASE_ID"
# Create the release
forgejo release create "v$VERSION" \
--title "Release $VERSION" \
--notes "Automated release created by CI" \
--repo root/resilient
# Upload artifact
curl -s -X POST "$API/repos/$REPO/releases/$RELEASE_ID/assets?name=resilient.jar" \
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
-H "Content-Type: application/java-archive" \
--data-binary @"target/resilient*.jar"
# Upload the JAR artifact
forgejo release upload "v$VERSION" target/resilient*.jar \
--repo root/resilient
# ##################################################################
# ## THIS IS A RELEASE - Change master version to next SNAPSHOT ##