build: update version to 0.3.11 #111
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: Publish Package to PyPi | |
| on: | |
| pull_request: | |
| types: [closed] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'version-update') | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Verify authorized merger | |
| env: | |
| AUTHORIZED_USERS: ${{ secrets.AUTHORIZED_RELEASE_USERS }} | |
| CURRENT_USER: ${{ github.event.pull_request.merged_by.login }} | |
| run: | | |
| if [[ ! ",$AUTHORIZED_USERS," == *",$CURRENT_USER,"* ]]; then | |
| echo "Error: User $CURRENT_USER is not authorized to merge version update PRs" | |
| exit 1 | |
| fi | |
| echo "User $CURRENT_USER is authorized to merge version update PRs" | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '==3.11' | |
| cache: 'pip' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Build package | |
| run: python -m build | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| # Trigger the docs workflow after successful publish | |
| - name: Trigger Documentation Update | |
| if: success() | |
| uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| event-type: publish-docs-event | |
| client-payload: '{"ref": "${{ github.ref }}", "sha": "${{ github.sha }}"}' |