diff --git a/.gitea/workflows/build-pdf.yaml b/.gitea/workflows/build-pdf.yaml index bf89263..086f1df 100644 --- a/.gitea/workflows/build-pdf.yaml +++ b/.gitea/workflows/build-pdf.yaml @@ -9,9 +9,14 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + contents: write + steps: - name: Checkout Code uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Install FiraCode Nerd Font run: | @@ -21,29 +26,34 @@ jobs: - name: Install Typst CLI run: | - # Download the latest CLI binary for Linux wget -qO- https://github.com/typst/typst/releases/latest/download/typst-x86_64-unknown-linux-musl.tar.xz | tar -xJ - - # Move binary to path (assuming standard Linux runner) mv typst-x86_64-unknown-linux-musl/typst /usr/local/bin/typst chmod +x /usr/local/bin/typst - name: Run Build Script - # We set the Environment Variable TYPST_FONT_PATHS so Typst knows where to look env: TYPST_FONT_PATHS: ./fonts run: | chmod +x build.sh ./build.sh - - name: Update Nightly Tag - # This moves the 'nightly' tag to the current commit + + - name: Delete Old Nightly Release & Tag + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + curl -X DELETE \ + -H "Authorization: token $GITHUB_TOKEN" \ + "$GITHUB_API_URL/repos/${{ gitea.repository }}/releases/tags/nightly" || true + + git tag -d nightly || true + git push origin :nightly || true + + - name: Create Nightly Tag run: | git config user.name "Gitea Actions" git config user.email "actions@gitea.local" - # Force create/move the tag locally - git tag -f nightly - # Force push the tag to the remote - git push -f origin nightly + git tag nightly + git push origin nightly - name: Publish Nightly Release uses: softprops/action-gh-release@v1 @@ -52,7 +62,6 @@ jobs: name: Nightly Build body: | **Automated Nightly Build** - Triggered by commit: `${{ gitea.sha }}` Date: ${{ gitea.event.head_commit.timestamp }} files: build/*.pdf