72 lines
2.1 KiB
YAML
72 lines
2.1 KiB
YAML
name: Run Release Please
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
release-please:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write # for googleapis/release-please-action to create release commit
|
|
pull-requests: write # for googleapis/release-please-action to create release PR
|
|
# Release-please creates a PR that tracks all changes
|
|
steps:
|
|
- uses: googleapis/release-please-action@a02a34c4d625f9be7cb89156071d8567266a2445 # v4
|
|
id: release
|
|
with:
|
|
token: ${{secrets.GITHUB_TOKEN}}
|
|
target-branch: main
|
|
- name: Dump Release Please Output
|
|
env:
|
|
RELEASE_PLEASE_OUTPUT: ${{ toJson(steps.release.outputs) }}
|
|
run: |
|
|
echo "$RELEASE_PLEASE_OUTPUT"
|
|
outputs:
|
|
release_created: ${{ steps.release.outputs.releases_created }}
|
|
all: ${{ toJSON(steps.release.outputs) }}
|
|
paths_released: ${{ steps.release.outputs.paths_released }}
|
|
|
|
pypi-release:
|
|
needs: release-please
|
|
runs-on: ubuntu-latest
|
|
if: ${{ fromJSON(needs.release-please.outputs.release_created || false) }}
|
|
strategy:
|
|
matrix:
|
|
path: ${{ fromJSON(needs.release-please.outputs.paths_released || '[]') }}
|
|
environment: publish
|
|
permissions:
|
|
# IMPORTANT: this permission is mandatory for trusted publishing to pypi
|
|
id-token: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install uv and set the python version
|
|
uses: astral-sh/setup-uv@7edac99f961f18b581bbd960d59d049f04c0002f # v6
|
|
with:
|
|
python-version: "3.13"
|
|
|
|
- name: Install dependencies
|
|
working-directory: ${{ matrix.path }}
|
|
run: uv sync --frozen
|
|
|
|
- name: Build a binary wheel and a source tarball
|
|
working-directory: ${{ matrix.path }}
|
|
run: uv build
|
|
|
|
- name: Publish a Python distribution to PyPI
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
with:
|
|
# `uv` stores the build packages in the root `dist` folder
|
|
packages-dir: dist
|