Release library on GitHub #5
This file contains 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 library on GitHub" | |
on: | |
workflow_run: | |
workflows: ["Setup, Build, and Test"] | |
types: | |
- completed | |
branches: | |
- main | |
jobs: | |
release: | |
name: Release library | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
strategy: | |
matrix: | |
python-version: ["3.11"] # Config the virtual env - Python version 3.11 will be used only. | |
permissions: | |
contents: write # IMPORTANT: mandatory for making GitHub Releases | |
actions: read # IMPORTANT: mandatory for downloading artifacts | |
steps: | |
# Checkout GitHub branch's config | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Download binary package | |
- name: Download built package | |
uses: actions/download-artifact@v4 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
run-id: ${{ github.event.workflow_run.id }} | |
name: built-package | |
path: dist/ | |
# Generate checksums | |
- name: Generate SHA256 files for each wheel | |
run: | | |
sha256sum dist/*.whl > checksums.txt | |
cat checksums.txt | |
# Create release on GitHub | |
- name: Create release with SHA256 and Artifacts | |
uses: softprops/action-gh-release@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
files: | | |
dist/*.whl | |
checksums.txt |