-
Notifications
You must be signed in to change notification settings - Fork 367
62 lines (51 loc) · 1.7 KB
/
python-publish.yml
File metadata and controls
62 lines (51 loc) · 1.7 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
61
62
name: Publish Package
on:
push:
branches: [master]
permissions:
contents: write
pull-requests: write
jobs:
# On every push to master that is NOT a release commit, ask EasyBuild.ShipIt
# to open (or update) a "chore: release X.Y.Z" PR that bumps the version in
# CHANGELOG.md, pyproject.toml, and reactivex/_version.py.
shipit-pr:
name: ShipIt - Pull Request
runs-on: ubuntu-latest
if: "!startsWith(github.event.head_commit.message, 'chore: release ')"
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: '9.x'
- name: Restore .NET tools
run: dotnet tool restore
- name: Run ShipIt
run: dotnet shipit --pre-release rc --allow-branch master --skip-invalid-commit
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# When the "chore: release X.Y.Z" PR has been merged, publish to PyPI. The
# version in pyproject.toml has already been written by ShipIt's command
# updater (scripts/shipit_bump_version.sh), so we just build and publish.
release:
name: Release to PyPI
runs-on: ubuntu-latest
if: "startsWith(github.event.head_commit.message, 'chore: release ')"
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Build package
run: uv build
- name: Publish to PyPI
run: uv publish --token ${{ secrets.PYPI_API_TOKEN }} || echo 'Version exists'