Skip to content

Minor GHP updates

Minor GHP updates #150

Workflow file for this run

name: Check PyPi build and optionally publish to PyPi
permissions:
contents: read
concurrency:
group: pypi-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
on:
pull_request:
paths:
- compass/**
- README.rst
- pyproject.toml
- pixi.toml
- pixi.lock
- MANIFEST.in
- .github/workflows/publish_to_pypi.yml
push:
branches: [main]
paths:
- compass/**
- README.rst
- pyproject.toml
- pixi.toml
- pixi.lock
- MANIFEST.in
- .github/workflows/publish_to_pypi.yml
release:
types: [published]
workflow_dispatch:
jobs:
build:
name: Build, check, and optionally upload wheels
permissions:
# IMPORTANT: write permission is mandatory for Trusted Publishing
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
fetch-tags: true
- uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0
with:
pixi-version: v0.69.0
locked: true
# Don't use cache on release because we want the newest version of the tool to be built and distributed (specifically the new version tag)
cache: ${{ github.event_name != 'release' }}
cache-write: ${{ github.event_name != 'release' && github.ref == 'refs/heads/main' }}
environments: pbuild
- name: Clean README, build, and validate package metadata
run: |
VERSION=$(git describe --tags --match 'v*[0-9]*' --abbrev=0 | sed 's/^v//')
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_INFRA_COMPASS="$VERSION" pixi run -e pbuild check-wheels
- name: Publish package distributions to PyPI
if: github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0