Release #1
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: | |
release: | |
types: [published] | |
jobs: | |
test: | |
uses: ./.github/workflows/ci.yml | |
# If tests are successful, we build the wheel and push it to the release | |
build-wheel: | |
needs: test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup | |
with: | |
python-version: '3.13' | |
- name: Check package version matches tag | |
run: | | |
pkgver=$(python -c "import autocorpus; print(autocorpus.__version__, end='')") | |
# NB: tag name must be prefixed by "v" (the default for GitHub Releases) | |
test v$pkgver = ${{ github.ref_name }} | |
- name: Build package | |
run: poetry build | |
# Upload files as test artifact (to be retrieved later) | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: dist/* | |
# Publish files as release artifacts | |
- uses: softprops/action-gh-release@v2 | |
with: | |
files: dist/* | |
# If all goes well, publish to PyPI | |
publish-pypi: | |
needs: build-wheel | |
name: Publish to PyPI | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
steps: | |
- name: Download wheel and sdist artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- name: Display structure of downloaded files | |
run: ls -R dist | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |