chore: Add pre-commit hooks with config instructions #14
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
# Workflow for push commit to master branch | |
# This workflow uses python semantic releases, which relies on certain commit tags to | |
# determine if a new release/version should be created. | |
# Checkout https://github.com/python-semantic-release/python-semantic-release form more | |
# info on how to use it. | |
# Also checkout https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#type to | |
# which types of commit messages are accepted | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
test-and-lint: | |
uses: ./.github/workflows/test-and-lint.yaml | |
release: | |
name: Semantic Release | |
runs-on: ubuntu-latest | |
concurrency: push | |
needs: [test-and-lint] | |
if: github.repository == 'swvanbuuren/pqthreads' | |
environment: | |
name: pypi | |
url: https://pypi.org/project/pqthreads/ | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.ref_name }} | |
- name: Python Semantic Release | |
id: release | |
uses: python-semantic-release/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install uv | |
if: steps.release.outputs.released == 'true' | |
uses: astral-sh/setup-uv@v3 | |
- name: Set up Python | |
if: steps.release.outputs.released == 'true' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
- name: Build package | |
if: steps.release.outputs.released == 'true' | |
run: | | |
uv sync | |
uv build | |
- name: Publish package distributions to PyPI | |
if: steps.release.outputs.released == 'true' | |
id: pypi-publish | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
verbose: true | |
- name: Publish package distributions to GitHub Releases | |
if: steps.release.outputs.released == 'true' | |
id: github-release | |
uses: python-semantic-release/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ steps.release.outputs.tag }} |