v0.1.1 #3
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: PyPI publish on release | |
on: | |
release: | |
types: [published] | |
defaults: | |
run: | |
shell: | |
bash | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Verify tag matches version | |
run: | | |
set -ex | |
version=$(grep -m 1 version pyproject.toml | grep -P '\d+\.\d+\.\d+' -o) | |
tag="${GITHUB_REF/refs\/tags\/}" | |
if [[ "v$version" != "$tag" ]]; then | |
exit 1 | |
fi | |
- name: Setup uv | |
uses: ./.github/actions/setup-uv | |
- name: Set up Python | |
run: uv python install | |
- name: Build sdist and wheel | |
run: uv build | |
- name: Test installation of sdist and wheel | |
run: | | |
uv venv --no-project | |
uv pip install dist/*.tar.gz | |
uv pip install dist/*.whl | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/coqpit* | |
publish-artifacts: | |
runs-on: ubuntu-latest | |
needs: [build] | |
environment: | |
name: release | |
url: https://pypi.org/p/coqpit-config | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: "dist" | |
path: "dist/" | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |