Skip to content

Commit 562e512

Browse files
authored
ci: open the nightly PRs as the riseproject-dev github app (#2083)
* ci: open the nightly PRs as the riseproject-dev App Branches pushed and PRs opened with GITHUB_TOKEN raise no events, so the per-package upgrade PRs ended up with no checks at all. Mint a riseproject-dev installation token when RISEPROJECT_APP_ID is set and commit as its bot, falling back to GITHUB_TOKEN otherwise. * ci: publish and document as the riseproject-dev App The documentation PR is opened from _publish-wheel.yml, so it needs the App token too, or it keeps landing without checks. A reusable workflow gets no secret it is not handed, hence the one line in each build workflow.
1 parent 86a6bfb commit 562e512

712 files changed

Lines changed: 1518 additions & 12 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/_publish-wheel.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@ on:
2525
required: false
2626
default: ''
2727
type: string
28+
secrets:
29+
app-private-key:
30+
description: >-
31+
Private key of the riseproject-dev GitHub App. Without it the
32+
documentation PR is opened with GITHUB_TOKEN and gets no checks.
33+
required: false
2834

2935
concurrency:
3036
group: publish-wheel
@@ -35,10 +41,22 @@ jobs:
3541
publish:
3642
runs-on: ubuntu-latest
3743
steps:
44+
# A branch pushed or a PR opened with GITHUB_TOKEN raises no events, so
45+
# the documentation PR would sit there with no checks. Push and open it
46+
# as the App instead; without its credentials, or on a pull request
47+
# (where nothing is published anyway), this falls back to GITHUB_TOKEN.
48+
- uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
49+
id: app-token
50+
if: ${{ vars.RISEPROJECT_APP_CLIENT_ID != '' && github.ref == 'refs/heads/main' }}
51+
with:
52+
client-id: ${{ vars.RISEPROJECT_APP_CLIENT_ID }}
53+
private-key: ${{ secrets.app-private-key }}
54+
3855
- name: Checkout python-wheels
3956
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
4057
with:
4158
fetch-depth: 0
59+
token: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
4260

4361
- name: Download wheels
4462
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
@@ -136,7 +154,7 @@ jobs:
136154
- name: Create draft release and upload assets
137155
if: github.ref == 'refs/heads/main'
138156
env:
139-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157+
GH_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
140158
RELEASE_TAG: ${{ steps.release.outputs.tag }}
141159
RELEASE_TITLE: ${{ steps.release.outputs.title }}
142160
run: |
@@ -166,7 +184,7 @@ jobs:
166184
- name: Verify release is immutable
167185
if: github.ref == 'refs/heads/main'
168186
env:
169-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
187+
GH_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
170188
run: |
171189
immutable=$(gh api \
172190
"repos/${{ github.repository }}/releases/tags/${{ steps.release.outputs.tag }}" \
@@ -178,7 +196,8 @@ jobs:
178196
179197
- name: Update package documentation
180198
env:
181-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
199+
GH_TOKEN: ${{ steps.app-token.outputs.token || secrets.GITHUB_TOKEN }}
200+
APP_SLUG: ${{ steps.app-token.outputs.app-slug }}
182201
ARTIFACTS_PATH: ${{ inputs.artifact-path }}
183202
RELEASE_TAG: ${{ steps.release.outputs.tag }}
184203
GPL_SOURCES_DESCRIPTION: ${{ inputs.gpl-sources-description }}

.github/workflows/build-ada-url.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,7 @@ jobs:
9292
contents: write
9393
pull-requests: write
9494
uses: $/.github/workflows/_publish-wheel.yml
95+
secrets:
96+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
9597
with:
9698
artifact-pattern: ada-url-${{ matrix.version }}-*-manylinux_riscv64

.github/workflows/build-adbc-driver-manager.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,5 +110,7 @@ jobs:
110110
contents: write
111111
pull-requests: write
112112
uses: $/.github/workflows/_publish-wheel.yml
113+
secrets:
114+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
113115
with:
114116
artifact-pattern: adbc-driver-manager-${{ matrix.version }}-*-manylinux_riscv64

.github/workflows/build-adbc-driver-postgresql.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,5 +174,7 @@ jobs:
174174
contents: write
175175
pull-requests: write
176176
uses: $/.github/workflows/_publish-wheel.yml
177+
secrets:
178+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
177179
with:
178180
artifact-pattern: adbc-driver-postgresql-${{ matrix.version }}-*-manylinux_riscv64

.github/workflows/build-adbc-driver-sqlite.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,5 +165,7 @@ jobs:
165165
contents: write
166166
pull-requests: write
167167
uses: $/.github/workflows/_publish-wheel.yml
168+
secrets:
169+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
168170
with:
169171
artifact-pattern: adbc-driver-sqlite-${{ matrix.version }}-*-manylinux_riscv64

.github/workflows/build-aggdraw.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,5 +99,7 @@ jobs:
9999
contents: write
100100
pull-requests: write
101101
uses: $/.github/workflows/_publish-wheel.yml
102+
secrets:
103+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
102104
with:
103105
artifact-pattern: aggdraw-${{ matrix.version }}-*-manylinux_riscv64

.github/workflows/build-ahocorasick-rs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,7 @@ jobs:
101101
contents: write
102102
pull-requests: write
103103
uses: $/.github/workflows/_publish-wheel.yml
104+
secrets:
105+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
104106
with:
105107
artifact-pattern: ahocorasick-rs-${{ matrix.version }}-*-manylinux_riscv64

.github/workflows/build-aiocsv.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,7 @@ jobs:
9595
contents: write
9696
pull-requests: write
9797
uses: $/.github/workflows/_publish-wheel.yml
98+
secrets:
99+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
98100
with:
99101
artifact-pattern: aiocsv-${{ matrix.version }}-*riscv64

.github/workflows/build-aiokafka.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,7 @@ jobs:
112112
contents: write
113113
pull-requests: write
114114
uses: $/.github/workflows/_publish-wheel.yml
115+
secrets:
116+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
115117
with:
116118
artifact-pattern: aiokafka-${{ matrix.version }}-*-manylinux_riscv64

.github/workflows/build-aioquic.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,7 @@ jobs:
131131
contents: write
132132
pull-requests: write
133133
uses: $/.github/workflows/_publish-wheel.yml
134+
secrets:
135+
app-private-key: ${{ secrets.RISEPROJECT_APP_PRIVATE_KEY }}
134136
with:
135137
artifact-pattern: aioquic-${{ matrix.version }}-*-manylinux_riscv64

0 commit comments

Comments
 (0)