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
|
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" \
|
||||||
|
-d "{
|
||||||
|
\"tag_name\": \"v$VERSION\",
|
||||||
|
\"target_commitish\": \"master\",
|
||||||
|
\"name\": \"Release v$VERSION\",
|
||||||
|
\"body\": \"Automated release by CI\"
|
||||||
|
}")
|
||||||
|
|
||||||
# Configure Forgejo CLI with token
|
RELEASE_ID=$(echo "$RESPONSE" | jq -r '.id')
|
||||||
forgejo config --host https://git.oguerreiro.com --token "${{ secrets.FORGEJO_TOKEN }}"
|
|
||||||
|
|
||||||
# Extract version
|
echo "Created release ID: $RELEASE_ID"
|
||||||
VERSION="${{ steps.version.outputs.release_version }}"
|
|
||||||
|
|
||||||
# Create the release
|
# Upload artifact
|
||||||
forgejo release create "v$VERSION" \
|
curl -s -X POST "$API/repos/$REPO/releases/$RELEASE_ID/assets?name=resilient.jar" \
|
||||||
--title "Release $VERSION" \
|
-H "Authorization: token ${{ secrets.FORGEJO_TOKEN }}" \
|
||||||
--notes "Automated release created by CI" \
|
-H "Content-Type: application/java-archive" \
|
||||||
--repo root/resilient
|
--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 ##
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue