chore: cleanup release process #5
Workflow file for this run
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
# Release Tag workflow | |
name: release_tag | |
# TODO(Actions): | |
# - [ ] check that last commit is the CHANGES edit | |
# - [ ] infer the last RC version | |
# - [ ] run bumpver.py with the new version | |
# - [ ] push the commit and new tag | |
on: | |
workflow_dispatch: # on manual trigger | |
pull_request: # FIXME(before-merge): remove this trigger | |
jobs: | |
new-tag: | |
runs-on: ubuntu-latest | |
env: | |
CHANGES_FILE: CHANGES.rst | |
EXPECTED_DIFF_COUNT: 1 | |
steps: | |
- uses: actions/checkout@v3 | |
- id: get-diff | |
uses: technote-space/get-diff-action@v6 | |
with: | |
PATTERNS: | | |
${{ env.CHANGES_FILE }} | |
SET_ENV_NAME_COUNT: true | |
- id: check-changes | |
run: | | |
echo "${{ steps.get-diff.outputs.count }}/${{ env.EXPECTED_DIFF_COUNT }} changes in ${{ env.CHANGES_FILE }}." | |
# FIXME(before-merge): uncomment | |
# exit ${{ steps.get-diff.outputs.count == env.EXPECTED_DIFF_COUNT && 0 || 1 }} | |
- id: get-last-version | |
run: | | |
CHANGE_FILE=${{ env.CHANGES_FILE }} | |
LAST_VERSION=$(grep -m1 -E ' \([0-9]+-[0-9]+-[0-9]+\)$' ${CHANGE_FILE} | awk '{ print $1 }') | |
# FIXME: don't run it in dry mode | |
python3 bin/bumpver.py -n ${LAST_VERSION} |