ci: use gitea-release-action@v1 for release upload
Replaces the manual curl-based release creation with the standard action, consistent with other Gitea repos. Also bumps checkout to @v4. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,7 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install system dependencies
|
- name: Install system dependencies
|
||||||
run: |
|
run: |
|
||||||
@@ -41,26 +41,13 @@ jobs:
|
|||||||
cp builddir/ahfail-display dist/
|
cp builddir/ahfail-display dist/
|
||||||
tar czf ahfail-linux-x86_64.tar.gz -C dist .
|
tar czf ahfail-linux-x86_64.tar.gz -C dist .
|
||||||
|
|
||||||
- name: Create Gitea release and upload asset
|
- name: Upload release asset
|
||||||
# Requires a GITEA_TOKEN secret with write:repository scope.
|
# Requires a GITEA_TOKEN secret with write:repository scope.
|
||||||
# Create it in repo Settings → Secrets.
|
# Create it in repo Settings → Secrets.
|
||||||
env:
|
uses: https://gitea.com/actions/gitea-release-action@v1
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
with:
|
||||||
GITEA_URL: https://gitea.weircon.dk
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
REPO: agw/gtk-ahfail
|
server_url: ${{ github.server_url }}
|
||||||
TAG: ${{ github.ref_name }}
|
tag_name: ${{ github.ref_name }}
|
||||||
run: |
|
name: ${{ github.ref_name }}
|
||||||
set -euo pipefail
|
files: ahfail-linux-x86_64.tar.gz
|
||||||
RELEASE_ID=$(curl -f -X POST \
|
|
||||||
"${GITEA_URL}/api/v1/repos/${REPO}/releases" \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
-d "{\"tag_name\":\"${TAG}\",\"name\":\"${TAG}\",\"draft\":false}" \
|
|
||||||
| python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
|
|
||||||
|
|
||||||
[ -n "${RELEASE_ID}" ] || { echo "ERROR: empty RELEASE_ID from API"; exit 1; }
|
|
||||||
|
|
||||||
curl -f -X POST \
|
|
||||||
"${GITEA_URL}/api/v1/repos/${REPO}/releases/${RELEASE_ID}/assets" \
|
|
||||||
-H "Authorization: token ${GITEA_TOKEN}" \
|
|
||||||
-F "attachment=@ahfail-linux-x86_64.tar.gz"
|
|
||||||
|
|||||||
Reference in New Issue
Block a user