[IMP] pre-commit check #2
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: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout Repository on Release Branch | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.ref_name }} | |
| - name: Force release branch to be at workflow sha | |
| run: | | |
| git reset --hard ${{ github.sha }} | |
| - name: Semantic Version Release | |
| id: release | |
| uses: python-semantic-release/python-semantic-release@v10.5.2 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| git_committer_name: "github-actions" | |
| git_committer_email: "actions@users.noreply.github.com" | |
| outputs: | |
| released: ${{ steps.release.outputs.released || 'false' }} | |
| tag: ${{ steps.release.outputs.tag }} | |
| publish: | |
| runs-on: ubuntu-latest | |
| needs: release | |
| if: ${{ needs.release.outputs.released == 'true' }} | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/trobz-agent | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Check out at new tag | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ needs.release.outputs.tag }} | |
| - name: Set up the environment | |
| uses: ./.github/actions/setup-python-env | |
| - name: Build Package | |
| run: make build | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@v1.13.0 | |
| with: | |
| packages-dir: dist |