fix: build+package в одной джобе (upload-artifact несовместим с Gitea)
All checks were successful
build-test / build (push) Successful in 38s

This commit is contained in:
Hermes
2026-08-15 10:48:51 +05:00
parent de43236e0b
commit 39a79f78fc

View File

@@ -31,7 +31,8 @@ jobs:
- name: Vet
run: go vet ./...
build:
build-and-package:
if: always()
needs: test
runs-on: ubuntu-latest
steps:
@@ -45,21 +46,8 @@ jobs:
- name: Build binary
run: go build -ldflags="-s -w" -o ratatoskr ./cmd/ratatoskr/
- uses: actions/upload-artifact@v4
with:
name: ratatoskr
path: ratatoskr
package:
if: gitea.ref == 'refs/heads/main'
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: ratatoskr
- name: Upload to Gitea Packages
if: gitea.ref == 'refs/heads/main'
run: |
VERSION="commit-$(echo '${{ gitea.sha }}' | cut -c1-7)"
curl -sS -X PUT \
@@ -70,6 +58,7 @@ jobs:
echo "Uploaded version ${VERSION}"
- name: Update latest tag
if: gitea.ref == 'refs/heads/main'
run: |
curl -sS -X PUT \
-H "Authorization: token ${{ secrets.TC_GITEA_TOKEN }}" \
@@ -77,3 +66,7 @@ jobs:
"${{ vars.GIT_MAIN_URL }}/api/packages/${{ gitea.actor }}/generic/ratatoskr/latest/ratatoskr" \
--data-binary @ratatoskr
echo "Updated 'latest' tag"
- name: Store binary (PR only)
if: gitea.ref != 'refs/heads/main'
run: ls -lh ratatoskr