Skip to content

Commit c8126ad

Browse files
authored
ci: 🐛 publishing and building need to be split (#91)
# Description PyPI Trusted Publishing doesn't yet support reusable workflows. So this splits out the publishing step to this repo and workflow. No review needed.
1 parent a272738 commit c8126ad

File tree

3 files changed

+44
-22
lines changed

3 files changed

+44
-22
lines changed

.github/sync.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ group:
3131
dest: .github/workflows/build-package.yml
3232
- source: .github/workflows/build-website.yml
3333
dest: .github/workflows/build-website.yml
34-
- source: .github/workflows/update-version.yml
35-
dest: .github/workflows/update-version.yml
34+
- source: .github/workflows/release-package.yml
35+
dest: .github/workflows/release-package.yml
3636
- source: .github/workflows/scorecards.yml
3737
dest: .github/workflows/scorecards.yml
3838
- source: .github/_project-dependabot.yml

.github/workflows/release-package.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release package
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# Limit token permissions for security
9+
permissions: read-all
10+
11+
jobs:
12+
release-package:
13+
# Only give permissions for this job.
14+
permissions:
15+
contents: write
16+
uses: seedcase-project/.github/.github/workflows/reusable-release-package.yml@main
17+
with:
18+
app-id: ${{ vars.UPDATE_VERSION_APP_ID }}
19+
secrets:
20+
update-version-gh-token: ${{ secrets.UPDATE_VERSION_TOKEN }}
21+
22+
pypi-publish:
23+
name: Publish to PyPI
24+
runs-on: ubuntu-latest
25+
# Only give permissions for this job.
26+
permissions:
27+
# IMPORTANT: mandatory for trusted publishing.
28+
id-token: write
29+
environment:
30+
name: pypi
31+
needs:
32+
- release-package
33+
steps:
34+
- name: Download built distributions
35+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
36+
with:
37+
name: release-dists
38+
path: dist/
39+
40+
- name: Publish 📦 to PyPI
41+
# Only publish if the option is explicitly set in the calling workflow.
42+
run: uv publish --trusted-publishing always

.github/workflows/update-version.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)