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