chore: fix docs deploy, patch advisories, support Laravel 13 (#167) #16
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| tests: | |
| uses: ./.github/workflows/tests.yml | |
| secrets: inherit | |
| release: | |
| needs: tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Determine release flags | |
| id: flags | |
| env: | |
| TAG: ${{ github.ref_name }} | |
| run: | | |
| if [[ "$TAG" == *"-"* ]]; then | |
| echo "prerelease=--prerelease" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "prerelease=" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| TAG: ${{ github.ref_name }} | |
| PRERELEASE_FLAG: ${{ steps.flags.outputs.prerelease }} | |
| run: | | |
| if gh release view "$TAG" >/dev/null 2>&1; then | |
| echo "Release $TAG already exists, skipping creation." | |
| exit 0 | |
| fi | |
| gh release create "$TAG" --generate-notes $PRERELEASE_FLAG | |
| cleanup: | |
| needs: tests | |
| if: failure() | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Delete tag on test failure | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| GH_REPO: ${{ github.repository }} | |
| TAG: ${{ github.ref_name }} | |
| run: gh api -X DELETE "repos/$GH_REPO/git/refs/tags/$TAG" |