diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index c6574f4..9aa9cc7 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -16,11 +16,20 @@ jobs: build-and-release: # Runner label 'ubuntu-latest' maps to golang:1.23-alpine container (see runner config) runs-on: ubuntu-latest + defaults: + run: + working-directory: /repo steps: - - uses: actions/checkout@v4 - - # Go is pre-installed in golang:1.23-alpine container – no setup-go needed + - name: Setup + working-directory: / + run: | + apk add --no-cache git curl jq + git clone --depth=1 \ + "http://x9:${{ secrets.FORGEJO_TOKEN }}@xetup-forgejo:3000/${{ github.repository }}.git" \ + /repo + cd /repo + git checkout "${{ github.sha }}" - name: Build xetup.exe run: | @@ -30,14 +39,12 @@ jobs: - name: Publish latest release env: TOKEN: ${{ secrets.FORGEJO_TOKEN }} - API: ${{ github.server_url }}/api/v1 + API: http://xetup-forgejo:3000/api/v1 REPO: ${{ github.repository }} run: | - apk add --no-cache curl jq + SHORT=$(echo "${{ github.sha }}" | cut -c1-7) - SHORT=$(echo "$GITHUB_SHA" | cut -c1-7) - - # Delete existing 'latest' release (and its tag) to recreate cleanly + # Delete existing 'latest' release and tag to recreate cleanly RID=$(curl -sf -H "Authorization: token $TOKEN" \ "$API/repos/$REPO/releases/tags/latest" | jq -r '.id // empty') if [ -n "$RID" ]; then @@ -55,7 +62,7 @@ jobs: -d "{\"tag_name\":\"latest\",\"name\":\"latest\",\"body\":\"Auto-built from ${SHORT}\",\"prerelease\":true}" \ | jq -r '.id') - # Upload xetup.exe as release asset + # Upload xetup.exe curl -sf -X POST \ -H "Authorization: token $TOKEN" \ -H "Content-Type: application/octet-stream" \ @@ -63,4 +70,3 @@ jobs: --data-binary @xetup.exe echo "Released xetup.exe (commit ${SHORT})" -