Skip to content

Update pixi lockfile #45

Update pixi lockfile

Update pixi lockfile #45

Workflow file for this run

name: Release
on:
push:
branches:
- main
tags:
- '*.*.*'
pull_request:
jobs:
build:
name: Build Package
runs-on: ubuntu-latest
steps:
- name: Checkout branch
uses: actions/checkout@v4
- name: Set up pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
environments: release
- name: Ensure tag matches version
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}
run: |
version="$(pixi exec -s go-yq -- yq .project.version pyproject.toml)"
tag="${{ github.ref_name }}"
if [ "$version" != "$tag" ]; then
echo "Tag $tag does not match version $version"
exit 1
fi
- name: Build
run: pixi run -e release hatch build
- name: Check build
run: pixi run -e release twine check dist/*
- name: List files
run: ls -l dist/
- name: Upload package
uses: actions/upload-artifact@v4
with:
name: artifact
path: dist/*
release:
name: Publish Package
if: startsWith(github.ref, 'refs/tags/')
needs: [build]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
environment: pypi
steps:
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Publish package on TestPyPi
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0
with:
repository-url: https://test.pypi.org/legacy/
- name: Publish package on PyPi
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0