Daily Release #75
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: Daily Release | |
| on: | |
| schedule: | |
| - cron: '30 7 * * *' # 5:30 PM AEST (7:30 AM UTC) | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: write | |
| pull-requests: write | |
| concurrency: | |
| group: daily-release | |
| cancel-in-progress: false | |
| jobs: | |
| determine-version: | |
| name: Determine Daily Version | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.compute.outputs.version }} | |
| should_release: ${{ steps.compute.outputs.should_release }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: main | |
| - name: Fetch tags | |
| run: git fetch --tags --force | |
| - name: Determine release necessity | |
| id: compute | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| TZ_REGION="Australia/Brisbane" | |
| TODAY=$(TZ="$TZ_REGION" date '+%Y.%-m.%-d') | |
| echo "Evaluating release for ${TODAY} (5:30 PM AEST schedule)" | |
| LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "") | |
| if [[ -z "$LAST_TAG" ]]; then | |
| echo "No previous releases found. Creating initial release." | |
| echo "Computed daily release version: ${TODAY}" | |
| echo "version=${TODAY}" >> "$GITHUB_OUTPUT" | |
| echo "should_release=true" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| # Check for meaningful changes (ignoring chore commits) | |
| COMMITS=$(git log "$LAST_TAG"..HEAD --pretty=format:"%s") | |
| # Filter out release commits and ci commits | |
| MEANINGFUL_COMMITS=$(echo "$COMMITS" | grep -vE "^chore\(release\):|^ci:" || true) | |
| if [[ -z "$MEANINGFUL_COMMITS" ]]; then | |
| echo "No meaningful changes since ${LAST_TAG} (only chore commits). Skipping release." | |
| echo "should_release=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| if [[ "$LAST_TAG" == "$TODAY" ]]; then | |
| echo "A release for ${TODAY} already exists. Skipping to enforce daily cadence." | |
| echo "should_release=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| echo "New commits found since ${LAST_TAG}. Creating release." | |
| echo "Computed daily release version: ${TODAY}" | |
| echo "version=${TODAY}" >> "$GITHUB_OUTPUT" | |
| echo "should_release=true" >> "$GITHUB_OUTPUT" | |
| run-release-workflow: | |
| name: Trigger Release Workflow | |
| needs: determine-version | |
| if: needs.determine-version.outputs.should_release == 'true' | |
| uses: ./.github/workflows/release.yml | |
| with: | |
| version: ${{ needs.determine-version.outputs.version }} | |
| branch: main | |
| secrets: inherit |