scheduled-releases #22
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: scheduled-releases | |
| on: | |
| schedule: | |
| # Runs every Wednesday at 08:00 UTC (midnight PST / 1:00 AM PDT) | |
| - cron: '0 8 * * 3' | |
| # Allows manual triggering for convenience | |
| workflow_dispatch: | |
| jobs: | |
| tag-weekly-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for tags | |
| - name: Create release | |
| id: create-release | |
| run: | | |
| # Date in the format YYMMDD | |
| TAG="release/weekly/$(date +%y%m%d)" | |
| # Get previous weekly tag for sparse release notes | |
| PREV_TAG=$(git tag --list 'release/weekly/*' --sort=-creatordate | head -n 1) | |
| # gh release create will automatically create the tag if it doesn't exist | |
| # This triggers the build workflow's tag listener, unlike git tag + git push | |
| # which doesn't trigger workflows when done by Actions tokens | |
| gh release create "$TAG" \ | |
| --title "Weekly Release $(date +%y%m%d)" \ | |
| --generate-notes \ | |
| --notes-start-tag "$PREV_TAG" \ | |
| --fail-on-no-commits \ | |
| --prerelease |