diff --git a/scripts/bark-notify.sh b/.github/scripts/bark-notify.sh similarity index 100% rename from scripts/bark-notify.sh rename to .github/scripts/bark-notify.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbd507f..9383e50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,55 @@ jobs: path: dist/snapshot-* if-no-files-found: error + # Only create a release + attach dist/ assets when pushing a v* tag. + # On branch pushes / pull requests this step is skipped entirely. + - name: Upload release assets via Gitea API + if: startsWith(github.ref, 'refs/tags/v') + env: + GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + TAG_NAME="${{ github.ref_name }}" + + echo "Creating Gitea release for tag ${TAG_NAME}..." + + RELEASE_RESPONSE=$(curl -fsS -X POST "${{ github.api_url }}/repos/${{ github.repository }}/releases" \ + -H "accept: application/json" \ + -H "authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + -d "$(cat <