Skip to content

Commit c23563e

Browse files
committed
Deploy to GitHub Actions via Trusted Publishers
1 parent 0ad7a1e commit c23563e

File tree

3 files changed

+102
-3
lines changed

3 files changed

+102
-3
lines changed

.github/workflows/release.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Build package
2+
3+
on:
4+
push:
5+
pull_request:
6+
release:
7+
types:
8+
- published
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
# Always build & lint package.
16+
build-package:
17+
name: Build & verify package
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
fetch-depth: 0
24+
25+
- uses: hynek/build-and-inspect-python-package@v2
26+
27+
# Publish to Test PyPI on every commit on main.
28+
release-test-pypi:
29+
name: Publish in-dev package to test.pypi.org
30+
if: |
31+
github.repository_owner == 'python'
32+
&& github.event_name == 'push'
33+
&& github.ref == 'refs/heads/main'
34+
runs-on: ubuntu-latest
35+
needs: build-package
36+
37+
permissions:
38+
id-token: write
39+
40+
steps:
41+
- name: Download packages built by build-and-inspect-python-package
42+
uses: actions/download-artifact@v4
43+
with:
44+
name: Packages
45+
path: dist
46+
47+
- name: Publish to Test PyPI
48+
uses: pypa/gh-action-pypi-publish@release/v1
49+
with:
50+
repository-url: https://test.pypi.org/legacy/
51+
52+
# Publish to PyPI on GitHub Releases.
53+
release-pypi:
54+
name: Publish to PyPI
55+
# Only run for published releases.
56+
if: |
57+
github.repository_owner == 'python'
58+
&& github.event.action == 'published'
59+
runs-on: ubuntu-latest
60+
needs: build-package
61+
62+
permissions:
63+
id-token: write
64+
65+
steps:
66+
- name: Download packages built by build-and-inspect-python-package
67+
uses: actions/download-artifact@v4
68+
with:
69+
name: Packages
70+
path: dist
71+
72+
- name: Publish to PyPI
73+
uses: pypa/gh-action-pypi-publish@release/v1

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,5 @@ ENV/
8888
# Rope project settings
8989
.ropeproject
9090

91-
# CPython checkout for cherry_picker.
92-
cherry_picker/cpython
93-
9491
# pytest
9592
.pytest_cache/

RELEASING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Release Checklist
2+
3+
- [ ] check tests pass on [GitHub Actions](https://github.com/python/blurb/actions)
4+
[![GitHub Actions status](https://github.com/python/blurb/actions/workflows/main.yml/badge.svg)](https://github.com/python/blurb/actions/workflows/main.yml)
5+
6+
- [ ] Update [changelog](https://github.com/python/blurb/blob/main/CHANGELOG.md)
7+
8+
- [ ] Go to the [Releases page](https://github.com/python/blurb/releases) and
9+
10+
- [ ] Click "Draft a new release"
11+
12+
- [ ] Click "Choose a tag"
13+
14+
- [ ] Type the next `vX.Y.Z` version and select "**Create new tag: vX.Y.Z** on publish"
15+
16+
- [ ] Leave the "Release title" blank (it will be autofilled)
17+
18+
- [ ] Click "Generate release notes" and amend as required
19+
20+
- [ ] Click "Publish release"
21+
22+
- [ ] Check the tagged [GitHub Actions build](https://github.com/python/blurb/actions/workflows/release.yml)
23+
has deployed to [PyPI](https://pypi.org/project/blurb/#history)
24+
25+
- [ ] Check installation:
26+
27+
```bash
28+
python -m pip uninstall -y blurb && python -m pip install -U blurb && blurb help
29+
```

0 commit comments

Comments
 (0)