MAINT: Before make dist, only clean the build artefacts #46
Workflow file for this run
This file contains hidden or 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[0-9]*' | |
jobs: | |
run-tests: | |
name: Run all tests | |
uses: ./.github/workflows/testing.yml | |
with: | |
skip_codecov: true | |
check-semver-tag: | |
name: Check if the tag is in semantic version format | |
needs: [run-tests] | |
runs-on: ubuntu-latest | |
outputs: | |
publish_on: ${{ steps.variables.outputs.publish_on }} | |
strategy: | |
matrix: | |
python-version: ["3.13"] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Install a specific version of uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Copy build utils | |
run: cp -r .github/utils ../utils | |
- name: Decide where to publish and create output variables | |
id: variables | |
run: uv run python ../utils/please.py set_publish_on | |
- name: See outputs | |
run: echo "publish_on="${{ steps.variables.outputs.publish_on }} | |
# Ref: https://github.com/pypa/gh-action-pypi-publish | |
publish: | |
name: Build and publish Python π distributions π¦ to TestPyPI or PyPI | |
needs: [check-semver-tag] | |
runs-on: ubuntu-latest | |
if: ${{ needs.check-semver-tag.outputs.publish_on != '' }} | |
environment: | |
name: release | |
url: https://github.com/has2k1/plotnine | |
permissions: | |
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
strategy: | |
matrix: | |
python-version: ["3.13"] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Install a specific version of uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Packages | |
run: uv run uv pip install build | |
- name: Build a wheel and a source tarball | |
run: make dist | |
- name: Publish distribution π¦ to Test PyPI | |
if: ${{ needs.check-semver-tag.outputs.publish_on == 'testpypi' }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
skip-existing: true | |
- name: Publish distribution π¦ to PyPI | |
if: ${{ needs.check-semver-tag.outputs.publish_on == 'pypi' }} | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
skip-existing: true | |
- name: Build Website (Dev) | |
if: ${{ needs.check-semver-tag.outputs.publish_on == 'testpypi' }} | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.PLOTNINE_WEBSITE }} | |
repository: has2k1/plotnine.org | |
event-type: plotnine-pre-release | |
- name: Build Website | |
if: ${{ needs.check-semver-tag.outputs.publish_on == 'pypi' }} | |
uses: peter-evans/repository-dispatch@v3 | |
with: | |
token: ${{ secrets.PLOTNINE_WEBSITE }} | |
repository: has2k1/plotnine.org | |
event-type: plotnine-release |