-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (49 loc) · 1.65 KB
/
release-please.yml
File metadata and controls
57 lines (49 loc) · 1.65 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
# Automate generation of release PRs using Conventional Commits
# See https://github.com/googleapis/release-please
name: release-please
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
release-please:
timeout-minutes: 30
runs-on: ubuntu-latest
# expose the step outputs at the job level so other jobs can use them
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Run release-please
id: release
uses: googleapis/release-please-action@v4
with:
# Use whatever token you currently use; GITHUB_TOKEN also works
token: ${{ secrets.GHA_NODEJS_TOKEN }}
config-file: .release-please-config.json
manifest-file: .release-please-manifest.json
publish:
name: Build & publish to PyPI
needs: release-please
# only run if a release/tag was created by the job above
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
# not strictly required by pypa/gh-action-pypi-publish, but fine to leave minimal
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install build backend
run: |
python -m pip install --upgrade pip
pip install build
- name: Build sdist and wheel
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}