From 87696710968d1c270c88b39738e2fac79720be51 Mon Sep 17 00:00:00 2001 From: Corey Oordt Date: Sat, 28 Oct 2023 08:19:36 -0500 Subject: [PATCH] Fixed versioning --- .github/workflows/bumpversion.yaml | 41 +++++++++++++----------------- .github/workflows/release.yaml | 20 +++++++-------- 2 files changed, 27 insertions(+), 34 deletions(-) diff --git a/.github/workflows/bumpversion.yaml b/.github/workflows/bumpversion.yaml index 5d2f00a3..2137d7fc 100644 --- a/.github/workflows/bumpversion.yaml +++ b/.github/workflows/bumpversion.yaml @@ -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: @@ -54,24 +37,22 @@ 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) @@ -79,9 +60,21 @@ jobs: 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 }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f49af1f7..0b782f11 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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: