v0.4.4 #16
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-main | |
on: | |
release: | |
types: [published] | |
jobs: | |
set-version: | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Export tag | |
id: vars | |
run: | | |
tag=${GITHUB_REF#refs/*/} | |
echo version=${tag#v} >> $GITHUB_OUTPUT | |
if: ${{ github.event_name == 'release' }} | |
- name: Update project version | |
run: | | |
sed -i "s/^version = \".*\"/version = \"$RELEASE_VERSION\"/" pyproject.toml packages/*/pyproject.toml | |
env: | |
RELEASE_VERSION: ${{ steps.vars.outputs.version }} | |
if: ${{ github.event_name == 'release' }} | |
- name: Upload updated pyproject.toml | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pyproject-toml | |
path: | | |
pyproject.toml | |
packages/*/pyproject.toml | |
build: | |
runs-on: ubuntu-latest | |
needs: [set-version] | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up the environment | |
uses: ./.github/actions/setup-python-env | |
- name: Download updated pyproject.toml | |
uses: actions/download-artifact@v4 | |
with: | |
name: pyproject-toml | |
- name: Build packages | |
run: uv run poe build | |
- name: List packages | |
run: ls -R dist | |
- name: Upload dist packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
publish: | |
runs-on: ubuntu-latest | |
needs: [build] | |
environment: pypi | |
permissions: | |
actions: read # for downloading artifacts (actions/download-artifact) | |
contents: read # for repository contents (actions/checkout) | |
id-token: write # for pypi environment | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
- name: Set up the environment | |
uses: ./.github/actions/setup-python-env | |
- name: Download dist packages | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Publish package | |
run: uv publish |