Merge pull request #34 from mfisher87/post-anaconda-tos-2024 #26
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
# Automatically create a GitHub Release for every push to the `main` branch | |
name: "Auto-release (calver) and trigger Zenodo DOI" | |
on: | |
push: | |
branches: ["main"] | |
paths: | |
- ".github/workflows/auto-release.yml" | |
- "content/**" | |
# Run this workflow manually from the Actions tab | |
workflow_dispatch: | |
permissions: | |
contents: "write" | |
# Allow one concurrent deployment | |
concurrency: | |
group: "release" | |
cancel-in-progress: true | |
jobs: | |
release: | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v3" | |
- name: "Re-use name and e-mail of commit that triggered this workflow" | |
run: | | |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)" | |
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)" | |
- name: "Set up Python" | |
uses: "actions/setup-python@v5" | |
with: | |
python-version: '3.12' | |
# NOTE: To use the cache feature, we need a spec file, e.g. | |
# requirements.txt | |
# TODO: Is using the cache slower than setting up the env fresh | |
# each time? It's a small env. | |
# cache: 'pip' | |
- name: "Install bumpver" | |
run: "pip install bumpver" | |
- name: "Bump version and tag" | |
run: "bumpver update --push" | |
- name: "Get new version number" | |
id: "get_version" | |
run: "bumpver show --no-fetch --environ >> $GITHUB_OUTPUT" | |
- name: "Create Release" | |
uses: "softprops/action-gh-release@v1" | |
with: | |
tag_name: "${{ steps.get_version.outputs.CURRENT_VERSION }}" | |
name: "${{ steps.get_version.outputs.CURRENT_VERSION }}: Auto-release" | |
generate_release_notes: true | |
draft: false | |
prerelease: false |