diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index baff977..9a01217 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -6,11 +6,14 @@ name: Python package -on: workflow_dispatch +on: + push: + branches: + -stable + workflow_dispatch: jobs: build: - runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -18,9 +21,6 @@ jobs: python-version: ["3.10", "3.11"] os: [macos-latest,ubuntu-latest,windows-latest] - permissions: - contents: write # Necessary for creating releases apparently. - steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} @@ -48,23 +48,36 @@ jobs: - uses: actions/upload-artifact@v3 with: path: ./wheelhouse/*.whl + + release: + # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ + needs: + - build + runs-on: ubuntu-latest - # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ - - name: Create GitHub Release - env: - GITHUB_TOKEN: ${{ github.token }} - run: >- - gh release create - '${{ github.ref_name }}' - --repo '${{ github.repository }}' - --notes "" - - name: Upload artifact signatures to GitHub Release - env: - GITHUB_TOKEN: ${{ github.token }} - # Upload to GitHub Release using the `gh` CLI. - # `dist/` contains the built packages, and the - # sigstore-produced signatures and certificates. - run: >- - gh release upload - '${{ github.ref_name }}' ./wheelhouse/*.whl - --repo '${{ github.repository }}' + permissions: + contents: write # Necessary for creating releases apparently. + + steps: + + - name: Download Artifacts + uses: actions/download-artifact@v3 + with: + path: ./wheelhouse/*.whl + + - name: Create GitHub Release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release create + '${{ github.ref_name }}' + --repo '${{ github.repository }}' + --notes "" + + - name: Connect Artifacts to release + env: + GITHUB_TOKEN: ${{ github.token }} + run: >- + gh release upload + '${{ github.ref_name }}' ./wheelhouse/*.whl + --repo '${{ github.repository }}'