comlink-python release #44
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
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
| name: comlink-python release | |
| on: | |
| workflow_dispatch: | |
| # push: | |
| # branches: | |
| # - main | |
| jobs: | |
| release: | |
| name: Semantic Release | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: ./scripts | |
| concurrency: | |
| group: ${{ github.workflow }}-release-${{ github.ref_name }} | |
| cancel-in-progress: false | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/swgoh-comlink/ | |
| permissions: | |
| id-token: write | |
| contents: write | |
| steps: | |
| - name: Check-out repository | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| fetch-depth: 0 | |
| # Install dependencies | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| pip install hatch | |
| # Build the package using python3 -m build | |
| - name: Build the package | |
| run: | | |
| python3 -m pip install --upgrade setuptools wheel build uv | |
| python3 -m build | |
| # Tag the release in GitHub | |
| - name: Tag the release | |
| run: | | |
| VERSION=$(hatch version) | |
| git config user.name "$(git log -n 1 --pretty=format:%an)" | |
| git config user.email "$(git log -n 1 --pretty=format:%ae)" | |
| git tag -a "v$VERSION" -m "Release version $VERSION" | |
| git push origin "v$VERSION" | |
| uv run hatch version "$VERSION" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Update CHANGELOG.md | |
| - name: Update CHANGELOG.md | |
| run: | | |
| python3 install git-changelog | |
| git-changelog -B auto -Tio CHANGELOG.md -c angular -s build,deps,fix,feat,refactor -n semver | |
| # Publish the package to PyPI | |
| pypi-publish: | |
| runs-on: ubuntu-latest | |
| needs: | |
| - release | |
| permissions: | |
| # IMPORTANT: this permission is mandatory for trusted publishing | |
| id-token: write | |
| contents: write | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/project/swgoh-comlink/ | |
| steps: | |
| - name: Retrieve release distributions | |
| uses: actions/download-artifact@v4 | |
| - name: Publish release distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc |