From 0020a41b931d936abd1831e290229836d98e8864 Mon Sep 17 00:00:00 2001 From: Sebastian Maj Date: Tue, 9 Nov 2021 19:10:56 -0500 Subject: [PATCH] Sebastianmaj/masteronlybump (#58) * Version bump should only happen on master * Changed minor to patch version bumps * Create release once version bumped on master * Restrict specific tasks to master only * Quick refactor on push event * Fix for invalid workflow sequence * Arguments sequence fix --- .bumpversion.cfg | 2 +- .github/workflows/publish-to-pypi-test.yml | 29 ++++++++++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 3b85263..55df4d5 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.11.0 +current_version = 0.11.2 commit = True tag = True diff --git a/.github/workflows/publish-to-pypi-test.yml b/.github/workflows/publish-to-pypi-test.yml index 4a65cc6..76f3a9a 100644 --- a/.github/workflows/publish-to-pypi-test.yml +++ b/.github/workflows/publish-to-pypi-test.yml @@ -1,9 +1,6 @@ name: Publish Python 🐍 distribution 📦 to TestPyPI -on: - push: - branches-ignore: - - master +on: [push] jobs: rust-compile: @@ -76,6 +73,7 @@ jobs: - name: Install bump2version run: | python -m pip install bump2version + if: github.ref == 'refs/heads/master' - name: Assign Git User Email run: | @@ -111,8 +109,29 @@ jobs: uses: tj-actions/changed-files@v2.1 - name: Publish distribution 📦 to Test PyPI - if: github.ref == 'refs/heads/master' uses: pypa/gh-action-pypi-publish@master with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ + if: github.ref == 'refs/heads/master' + + release: + runs-on: ubuntu-latest + needs: [build-n-publish] + if: github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@master + - name: Create release + uses: Roang-zero1/github-create-release-action@master + with: + version_regex: ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+ + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create GitHub release + uses: Roang-zero1/github-upload-release-artifacts-action@master + with: + args: '[ + , ./dist/* + ]' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}