diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 9ec8b82..7deaaa7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,29 +1,29 @@ -on: +on: push: - tags: - - "v[0-9]+.[0-9]+.[0-9]+" + branches: + - main + jobs: - pypi_release: + release-please: runs-on: ubuntu-latest steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + release-type: python + package-name: splunk_kvstore_cli - uses: actions/checkout@v3 + if: ${{ steps.release.outputs.release_created }} - uses: actions/setup-python@v4 + if: ${{ steps.release.outputs.release_created }} with: python-version: "3.9" - - run: >- - python -m pip install build - - run: >- - python -m build - - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@v1.8.6 + - run: python -m pip install build + if: ${{ steps.release.outputs.release_created }} + - run: python -m build + if: ${{ steps.release.outputs.release_created }} + - uses: pypa/gh-action-pypi-publish@v1.8.6 + if: ${{ steps.release.outputs.release_created }} with: user: __token__ password: ${{ secrets.PYPI_API_TOKEN }} - gh_release: - runs-on: ubuntu-latest - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v3 - - run: | - gh release create ${{ github.ref_name }} --generate-notes