diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 3298b3b..26b3b85 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -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,10 +58,15 @@ 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 }}" \ -H "Content-Type: application/octet-stream" \ "${{ vars.GIT_MAIN_URL }}/api/packages/${{ gitea.actor }}/generic/ratatoskr/latest/ratatoskr" \ --data-binary @ratatoskr - echo "Updated 'latest' tag" \ No newline at end of file + echo "Updated 'latest' tag" + + - name: Store binary (PR only) + if: gitea.ref != 'refs/heads/main' + run: ls -lh ratatoskr \ No newline at end of file