Skip to content

scheduled-releases

scheduled-releases #21

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:
# Use a token with write permissions to push to the branch
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0 # Fetch all history for merging
- name: Create release
id: create-release
run: |
# Date in the format YYMMDD
TAG="release/weekly/$(date +%y%m%d)"
# 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 \
--prerelease
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}