CI #14
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: | |
push: | |
tags: | |
- "v*.*.*" | |
permissions: | |
contents: read | |
jobs: | |
build-python: | |
name: Build package distributions | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: "3.12" | |
- uses: yezz123/setup-uv@v4 | |
with: | |
uv-venv: venv | |
- name: Install dependencies | |
run: uv pip install -e . -r pyproject.toml --extra=dev build | |
- name: Build package | |
run: python -m build | |
- name: Upload package distributions as artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/* | |
release-pypi: | |
name: Publish PyPI release | |
runs-on: ubuntu-latest | |
needs: build-python | |
environment: | |
name: pypi | |
url: https://pypi.org/p/boomgate | |
permissions: | |
id-token: write | |
steps: | |
- name: Download distributions | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Publish package distributions to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
release-github: | |
name: Publish GitHub release | |
runs-on: ubuntu-latest | |
needs: build-python | |
permissions: | |
contents: write | |
steps: | |
- name: Download distributions | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Determine if the tag is a pre-release | |
id: prerelease_check | |
run: | | |
# Check if the tag matches the pre-release pattern | |
if [[ ${GITHUB_REF_NAME} =~ (a|b|rc)[0-9]+$ ]]; then | |
echo "::set-output name=prerelease::true" | |
else | |
echo "::set-output name=prerelease::false" | |
fi | |
- name: Publish GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/* | |
fail_on_unmatched_files: true | |
prerelease: ${{ steps.prerelease_check.outputs.prerelease }} |