Skip to content

Commit

Permalink
Fixed versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
coordt committed Oct 28, 2023
1 parent 463082b commit 8769671
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 34 deletions.
41 changes: 17 additions & 24 deletions .github/workflows/bumpversion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,6 @@ on:
types: [closed]
branches: [master]
workflow_dispatch:
inputs:
dry_run:
description: Don't actually do the work, just describe it
default: true
type: boolean
new_version:
description: Set the version to a specific value
required: false
type: string
verbose:
description: The amount of output detail
default: 0
type: choice
options:
- "0"
- "1"
- "2"

jobs:
bumpversion:
Expand Down Expand Up @@ -54,34 +37,44 @@ jobs:
echo "::notice::Suggested release type is: ${RELEASE_KIND}"
echo "RELEASE_KIND=$RELEASE_KIND" >> $GITHUB_ENV
echo "release-kind=$RELEASE_KIND" >> $GITHUB_OUTPUT
echo "PACKAGE=false" >> $GITHUB_ENV
- name: Bump Version auto
if: ${{ github.event_name != 'workflow_dispatch' }}
shell: bash
run: |
if [[ $RELEASE_KIND != "no-release" ]]; then
bump-my-version -v "$RELEASE_KIND"
bump-my-version bump -v "$RELEASE_KIND"
git push
git push --tags
echo "PACKAGE=true" >> $GITHUB_ENV
fi
- name: Bump Version manual
if: ${{ github.event_name == 'workflow_dispatch' }}
shell: bash
env:
BUMPVERSION_DRY_RUN: ${{ inputs.dry_run }}
BUMPVERSION_NEW_VERSION: ${{ inputs.tags }}
BUMPVERSION_VERBOSE: ${{ inputs.verbose }}
run: |
case "$RELEASE_KIND" in
major|minor|patch)
bump-my-version bump "$RELEASE_KIND"
if [[ BUMPVERSION_DRY_RUN == "false" ]]; then
git push
git push --tags
echo "PACKAGE=true" >> $GITHUB_ENV
fi
;;
release-candidate)
bump-my-version bump --no-commit "$RELEASE_KIND"
dev)
bump-my-version bump -v --no-commit "$RELEASE_KIND"
echo "PACKAGE=true" >> $GITHUB_ENV
;;
esac
- name: Package
if: ${{ env.PACKAGE == 'true' }}
uses: hynek/build-and-inspect-python-package@v1

- name: Upload dev release to PyPI
if: ${{ env.PACKAGE == 'true' && env.RELEASE_KIND == 'dev' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
20 changes: 10 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ on:

jobs:
# Package when a new tag is pushed
build-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.PAT }}

- name: Package
uses: hynek/build-and-inspect-python-package@v1
# build-package:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# fetch-depth: 0
# token: ${{ secrets.PAT }}
#
# - name: Package
# uses: hynek/build-and-inspect-python-package@v1

# Create a GitHub release
release:
Expand Down

0 comments on commit 8769671

Please sign in to comment.