Monthly Release #1
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: Monthly Release | |
| on: | |
| schedule: | |
| # Run on the 1st of every month at 00:00 UTC | |
| - cron: '0 0 1 * *' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Create monthly snapshot release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| with: | |
| fetch-depth: 0 | |
| - name: Generate release tag | |
| id: tag | |
| run: | | |
| TAG="v$(date +'%Y.%m')" | |
| echo "tag=${TAG}" >> "$GITHUB_OUTPUT" | |
| echo "Release tag: ${TAG}" | |
| - name: Generate release notes | |
| id: notes | |
| run: | | |
| TAG="${{ steps.tag.outputs.tag }}" | |
| PREVIOUS_TAG=$(git tag --sort=-version:refname | head -n1) | |
| if [ -z "$PREVIOUS_TAG" ]; then | |
| echo "First release - no previous tag found" | |
| cat >> "$GITHUB_OUTPUT" <<EOF | |
| notes<<NOTES_EOF | |
| Monthly snapshot release ${TAG} | |
| This is an automated monthly snapshot of bluefin-common configuration files. | |
| NOTES_EOF | |
| EOF | |
| else | |
| echo "Generating notes since ${PREVIOUS_TAG}" | |
| cat >> "$GITHUB_OUTPUT" <<EOF | |
| notes<<NOTES_EOF | |
| Monthly snapshot release ${TAG} | |
| ## Changes since ${PREVIOUS_TAG} | |
| $(git log "${PREVIOUS_TAG}..HEAD" --pretty=format:'- %s (%h)' --no-merges) | |
| --- | |
| *This is an automated monthly snapshot of bluefin-common configuration files.* | |
| NOTES_EOF | |
| EOF | |
| fi | |
| - name: Create Release | |
| uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1.20.0 | |
| with: | |
| tag: ${{ steps.tag.outputs.tag }} | |
| name: ${{ steps.tag.outputs.tag }} | |
| body: ${{ steps.notes.outputs.notes }} | |
| draft: false | |
| prerelease: false | |
| makeLatest: true |