Skip to content

feat: Unveil the new Homebrew tap #8

feat: Unveil the new Homebrew tap

feat: Unveil the new Homebrew tap #8

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Run linters and tests
on: [push, pull_request]
jobs:
build:
name: Linters and tests
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@v4
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: make setup-dev
- name: Run linters
run: make lint
- name: Run tests
run: make test
release:
name: Create release
runs-on: ubuntu-latest
concurrency: release
if: github.ref_name == 'main'
needs:
- build
permissions:
id-token: write
contents: write
environment:
name: pypi
url: https://pypi.org/p/baymesh
steps:
# Note: we need to checkout the repository at the workflow sha in case during the workflow
# the branch was updated. To keep PSR working with the configured release branches,
# we force a checkout of the desired release branch but at the workflow sha HEAD.
- name: Setup | Checkout Repository at workflow sha
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.sha }}
- name: Setup | Force correct release branch on workflow sha
run: |
git checkout -B ${{ github.ref_name }} ${{ github.sha }}
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.python-version }}
- name: Action | Semantic Version Release
id: release
# Adjust tag with desired version if applicable.
uses: python-semantic-release/python-semantic-release@v9.15.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
git_committer_name: "github-actions"
git_committer_email: "actions@users.noreply.github.com"
# Ensures that uv.lock is up to date with the new version number
- name: Run uv sync
run: uv sync
- name: Build the project
run: make dist
- name: Publish | Upload package to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.3
if: steps.release.outputs.released == 'true'
- name: Publish | Upload to GitHub Release Assets
uses: python-semantic-release/publish-action@v9.15.2
if: steps.release.outputs.released == 'true'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.release.outputs.tag }}