Skip to content

Publish

Publish #5

Workflow file for this run

name: Publish
on:
workflow_dispatch:
permissions:
contents: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install dependencies
run: python -m pip install build
- uses: prefix-dev/setup-pixi@v0.10.0
with:
pixi-version: v0.71.3
- name: Get version
run: |
VERSION=$(python -c 'import tomllib; print("v" + tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Build PyPI package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
- name: Build and publish to Prefix.dev
run: pixi publish --target-channel https://prefix.dev/willow-ahrens/binsparse
- name: Create a release
uses: softprops/action-gh-release@v3
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
name: Release ${{ env.VERSION }}
make_latest: true
tag_name: ${{ env.VERSION }}