Create Release #1
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: Create Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag_name: | |
| required: true | |
| type: string | |
| release: | |
| description: "Whether to create a GitHub Release" | |
| type: boolean | |
| default: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup venv | |
| run: | | |
| python -m venv .venv | |
| . .venv/bin/activate | |
| python -m pip install build | |
| - name: Build | |
| run: | | |
| . .venv/bin/activate | |
| python -m build | |
| - name: Create Release | |
| shell: bash | |
| env: | |
| TAG_NAME: ${{ inputs.tag_name }} | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| release_args=( | |
| "$TAG_NAME" | |
| --title "${TAG_NAME}" | |
| --target "$GITHUB_SHA" | |
| --generate-notes | |
| ) | |
| # check for e.g., v1.1.0-rc0 | |
| if [[ $TAG_NAME == *-* ]]; then | |
| release_args+=( --prerelease ) | |
| fi | |
| gh release create "${release_args[@]}" dist/*.whl |