Annual Release #1
This file contains 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: Annual Release | |
on: | |
schedule: | |
# Schedule to run at midnight on quarterly basis | |
- cron: '0 0 30 3,6,9,12 *' | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout your repository | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
# Set up Git user | |
- name: Configure Git | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
# Create a tag for the release | |
- name: Create Tag | |
run: | | |
RELEASE="$(date +"%Y").$(date +"%m")" | |
echo "RELEASE=$RELEASE" >> $GITHUB_ENV | |
git tag -a $RELEASE -m "Automatic release $RELEASE" | |
git push origin release-$RELEASE | |
# Create a GitHub Release | |
- name: Create GitHub Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: "${{ env.RELEASE }}" | |
release_name: "Automatic Release ${{ env.RELEASE }}" | |
draft: false | |
prerelease: false | |
body: "${{ env.RELEASE }} release of the R-Ladies guide." |