Repository navigation
chore: Upgrade Python requirements (#331) #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| push: | |
| branches: [master] | |
| jobs: | |
| run_ci: | |
| uses: ./.github/workflows/ci.yml | |
| release: | |
| needs: run_ci | |
| runs-on: ubuntu-latest | |
| if: github.ref_name == 'master' | |
| concurrency: | |
| group: ${{ github.workflow }}-release-${{ github.ref_name }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| - name: Force branch to workflow sha | |
| run: git reset --hard ${{ github.sha }} | |
| - name: Run Semantic Release | |
| id: release | |
| uses: python-semantic-release/python-semantic-release@b700dbeb1f431a0fcc30a79f3f0869407fe07278 # v10.7.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| git_committer_name: "github-actions" | |
| git_committer_email: "actions@users.noreply.github.com" | |
| changelog: "false" | |
| vcs_release: "false" | |
| - name: Create GitHub Release with Assets | |
| if: steps.release.outputs.released == 'true' | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| RELEASE_NOTES: ${{ steps.release.outputs.release_notes }} | |
| TAG: ${{ steps.release.outputs.tag }} | |
| run: | | |
| printf '%s' "$RELEASE_NOTES" > "$RUNNER_TEMP/release_notes.md" | |
| gh release create "$TAG" \ | |
| --verify-tag \ | |
| --title "$TAG" \ | |
| --notes-file "$RUNNER_TEMP/release_notes.md" \ | |
| dist/* | |
| - name: Upload distribution artifacts | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| if: steps.release.outputs.released == 'true' | |
| with: | |
| name: distribution-artifacts | |
| path: dist | |
| if-no-files-found: error | |
| outputs: | |
| released: ${{ steps.release.outputs.released || 'false' }} | |
| version: ${{ steps.release.outputs.version }} | |
| publish_to_pypi: | |
| runs-on: ubuntu-latest | |
| needs: release | |
| if: github.ref_name == 'master' && needs.release.outputs.released == 'true' | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: distribution-artifacts | |
| path: dist | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 |