-
Notifications
You must be signed in to change notification settings - Fork 43
60 lines (48 loc) · 1.83 KB
/
release.yml
File metadata and controls
60 lines (48 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Release
on:
push:
branches:
- main
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
env:
TARGET_PYTHON_VERSION: "3.14"
jobs:
release-please:
permissions:
contents: write # for googleapis/release-please-action to create release commit
pull-requests: write # for googleapis/release-please-action to create release PR
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@45996ed1f6d02564a971a2fa1b5860e934307cf7 # v5
id: release
with:
token: ${{secrets.RELEASE_PLEASE_ACTION_TOKEN}}
target-branch: main
outputs:
release_created: ${{ steps.release.outputs.release_created }}
release_tag_name: ${{ steps.release.outputs.tag_name }}
release:
runs-on: ubuntu-latest
environment: publish
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing to pypi
id-token: write
needs: release-please
if: ${{ fromJSON(needs.release-please.outputs.release_created || false) }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install uv and set the python version
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
python-version: ${{ env.TARGET_PYTHON_VERSION }}
- name: Install dependencies
run: uv sync --frozen
- name: Build a binary wheel and a source tarball
run: uv build
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1