diff --git a/.github/workflows/bump.yaml b/.github/workflows/bump.yaml new file mode 100644 index 0000000..810a78c --- /dev/null +++ b/.github/workflows/bump.yaml @@ -0,0 +1,52 @@ +name: Bump + +on: + workflow_dispatch: + inputs: + version: + description: 'Version' + required: true + default: 'patch' + type: choice + options: + - major + - minor + - patch + +jobs: + bump: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + + - name: Install hatch + run: python3 -m pip install --upgrade hatch + + - name: Bump, commit, tag and push + run: | + git config --global user.name 'autobump' + git config --global user.email 'autobump' + VERSION=`hatch version` + hatch version ${{ inputs.version }} + NEW_VERSION=`hatch version` + git add ./src/kappe/__init__.py + git commit -m "Bump version: $VERSION → $NEW_VERSION" + git tag "v$NEW_VERSION" + git push + git push --tags + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + + - name: Create draft release + uses: ncipollo/release-action@v1 + with: + name: Release $NEW_VERSION + tag: v$NEW_VERSION + draft: true