Skip to content

Commit be39717

Browse files
separate publish
1 parent df94d68 commit be39717

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

.github/workflows/publish.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
name: Publish
22

3-
# pypi trusted publishing via OIDC
4-
permissions:
5-
id-token: write
6-
73
on:
84
pull_request:
9-
branches: [ main, dev ]
5+
branches: [ master, dev ]
106
push:
117
tags:
128
- 'v*.*.*'
@@ -15,8 +11,6 @@ on:
1511
jobs:
1612
build:
1713
runs-on: ubuntu-22.04
18-
environment: release-dev
19-
2014
steps:
2115
- name: Checkout code
2216
uses: actions/checkout@v4
@@ -35,11 +29,27 @@ jobs:
3529
- name: Show artifacts
3630
run: ls -lh ./dist
3731

38-
- uses: actions/upload-artifact@v4
32+
- name: Upload artifacts
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: built-artifacts
36+
path: ./dist/*
37+
38+
publish:
39+
runs-on: ubuntu-22.04
40+
needs: build
41+
environment: release-dev
42+
# pypi trusted publishing via OIDC
43+
permissions:
44+
id-token: write
45+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
46+
steps:
47+
- name: Download all artifacts
48+
uses: actions/download-artifact@v4
3949
with:
40-
name: dist-${{ matrix.os }}-${{ strategy.job-index }}
41-
path: ./dist/*.whl
50+
pattern: built-*
51+
path: dist
52+
merge-multiple: true
4253

4354
- name: Publish package
4455
uses: pypa/gh-action-pypi-publish@release/v1
45-
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'

0 commit comments

Comments
 (0)