chore: bump version (#8) #5
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: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
env: | |
pixi-version: "0.18.0" | |
jobs: | |
pypi-publish: | |
name: Publish release to PyPI | |
runs-on: ubuntu-22.04 | |
environment: release | |
permissions: | |
id-token: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install Pixi ${{ env.pixi-version }} | |
uses: prefix-dev/setup-pixi@v0.5.1 | |
with: | |
pixi-version: v${{ env.pixi-version }} | |
run-install: false | |
- name: Build release | |
run: pixi run --locked --environment build build | |
- name: Check that tag version and Pixi version match | |
run: '[[ "v$(pixi project version get)" == "${{ github.ref_name }}" ]]' | |
# TODO: find a better way to get the version from pyproject.toml | |
- name: Check that tag version and Pyproject version match | |
run: | | |
pyproject_version=$(pixi run --locked -e build python -c 'import tomllib; from pathlib import Path; print(f"v{tomllib.loads(Path("pyproject.toml").read_text())["project"]["version"]}")') | |
[[ $pyproject_version == "${{ github.ref_name }}" ]] | |
- name: Upload distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |