From 4a291ba6a32772b381262c8a5b05e8e1feb6042c Mon Sep 17 00:00:00 2001 From: Julianus Pfeuffer Date: Fri, 14 Jan 2022 13:41:22 +0100 Subject: [PATCH] setup new release cycle in release action --- .github/workflows/release-autowrap.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/release-autowrap.yaml b/.github/workflows/release-autowrap.yaml index 70a49e1f..d4eff812 100644 --- a/.github/workflows/release-autowrap.yaml +++ b/.github/workflows/release-autowrap.yaml @@ -6,6 +6,10 @@ name: release autowrap on: workflow_dispatch: # manual trigger + inputs: + next_version: + description: 'Next version (empty = minor bump)' + default: '' jobs: build_publish: @@ -52,3 +56,19 @@ jobs: body_path: CHANGELOG.md env: GITHUB_TOKEN: ${{ github.token }} + + - name: Setup things for new cycle + id: setup_new + run: | + NEXT_VER=${{ github.event.inputs.next_version }} + OLD_VER=${{ steps.version.outputs.version }} + [ -z "$NEXT_VER" ] && NEXT_VER=$(echo $OLD_VER | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g') || true + echo "\n" >> HISTORY.md + cat CHANGELOG.md >> HISTORY.md + rm CHANGELOG.md && echo "autowrap $NEXT_VER" > CHANGELOG.md + sed -i "s/.*__version__.*/__version__ = \(${OLD_VER//./, }\)/g" autowrap/version.py + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: New release cycle + file_pattern: CHANGELOG.md HISTORY.md autowrap/version.py