chore(deps): update pre-commit hook commitizen-tools/commitizen to v4 #135
Workflow file for this run
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: poetry-build | |
on: | |
push: | |
branches: ['**/**'] | |
pull_request: | |
branches: [main] | |
types: [opened, synchronize, reopened, ready_for_review] | |
jobs: | |
verify-with-tox: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 📄 Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
fetch-depth: 0 | |
- name: 🧱 Install Poetry | |
run: curl -sSL https://install.python-poetry.org | python3 - | |
- name: 🧱 Setup Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | |
with: | |
python-version: '3.12' | |
cache: poetry | |
- name: 🧱 Install dependencies | |
run: poetry install | |
- name: 🧪 Run tests | |
run: poetry run tox | |
- name: SonarCloud scan for PR | |
uses: sonarsource/sonarcloud-github-action@383f7e52eae3ab0510c3cb0e7d9d150bbaeab838 # v3 | |
if: github.event_name == 'pull_request' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: | | |
-Dsonar.pullrequest.base=${{ github.base_ref }} | |
-Dsonar.pullrequest.branch=${{ github.head_ref }} | |
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }} | |
- name: SonarCloud scan for Push | |
uses: sonarsource/sonarcloud-github-action@383f7e52eae3ab0510c3cb0e7d9d150bbaeab838 # v3 | |
if: github.event_name == 'push' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
with: | |
args: | | |
-Dsonar.branch.name=${{ github.head_ref }} | |
release-please: | |
needs: verify-with-tox | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/main' | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: 🚀 release-please | |
id: release | |
uses: googleapis/release-please-action@db8f2c60ee802b3748b512940dde88eabd7b7e01 # v3 | |
with: | |
release-type: python | |
include-v-in-tag: false | |
outputs: | |
release_created: ${{ steps.release.outputs.releases_created }} | |
version: ${{ steps.release.outputs.version }} | |
build-and-publish: | |
needs: release-please | |
runs-on: ubuntu-latest | |
if: ${{ needs.release-please.outputs.release_created == 'true' }} | |
permissions: | |
contents: write # Required for uploading artifacts to GitHub release | |
steps: | |
- name: 📄 Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
fetch-depth: 0 | |
- name: 🧱 Install Poetry | |
run: curl -sSL https://install.python-poetry.org | python3 - | |
- name: 🧱 Setup Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5 | |
with: | |
python-version: '3.12' | |
cache: poetry | |
- name: 🧱 Install dependencies | |
run: poetry install | |
- name: 📦 Build the package | |
run: poetry build | |
- name: 📦 Publish artifacts to GitHub release | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: gh release upload "${{ needs.release-please.outputs.version }}" dist/*.{tar.gz,whl} |