Update .forgejo/workflows/release.yml
Some checks failed
Release / release (push) Failing after 4m0s
Some checks failed
Release / release (push) Failing after 4m0s
This commit is contained in:
parent
cb96a7c37a
commit
ef24c21df4
1 changed files with 22 additions and 23 deletions
|
@ -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 ...
|
||||
|
||||
# Configure Forgejo CLI with token
|
||||
forgejo config --host https://git.oguerreiro.com --token "${{ secrets.FORGEJO_TOKEN }}"
|
||||
# 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\"
|
||||
}")
|
||||
|
||||
# Extract version
|
||||
VERSION="${{ steps.version.outputs.release_version }}"
|
||||
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
|
||||
|
||||
# Create the release
|
||||
forgejo release create "v$VERSION" \
|
||||
--title "Release $VERSION" \
|
||||
--notes "Automated release created by CI" \
|
||||
--repo root/resilient
|
||||
echo "Created release ID: $RELEASE_ID"
|
||||
|
||||
# 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 ##
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue