Skip to content

Commit 31a7a68

Browse files
authored
Merge pull request #27 from smkent/release
Create GitHub release independent of PyPI publishing
2 parents 482935d + 66c271e commit 31a7a68

5 files changed

Lines changed: 561 additions & 25 deletions

File tree

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454

5555
release:
5656
name: Create GitHub release
57-
needs: publish
57+
needs: build
5858
runs-on: ubuntu-latest
5959
permissions:
6060
contents: write

template/{% if project_visibility == 'public' %}.github{% endif %}/workflows/{% if enable_pypi %}release.yaml{% endif %}.jinja renamed to template/{% if project_visibility == 'public' %}.github{% endif %}/workflows/release.yaml.jinja

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,9 @@ jobs:
3131
name: dist
3232
path: dist/
3333

34-
publish:
35-
name: Publish to PyPI
36-
needs: build
37-
runs-on: ubuntu-latest
38-
environment:
39-
name: pypi
40-
url: https://pypi.org/project/{{ project_name }}/
41-
permissions:
42-
id-token: write
43-
attestations: write
44-
steps:
45-
- name: 🔽 Download artifact
46-
uses: actions/download-artifact@v8
47-
with:
48-
name: dist
49-
path: dist/
50-
51-
- name: ☢️ Publish to PyPI
52-
uses: pypa/gh-action-pypi-publish@release/v1
53-
with:
54-
attestations: true
55-
5634
release:
5735
name: Create GitHub release
58-
needs: publish
36+
needs: build
5937
runs-on: ubuntu-latest
6038
permissions:
6139
contents: write
@@ -75,4 +53,28 @@ jobs:
7553
run: gh release create {% raw %}${{ github.ref_name }}{% endraw %} dist/* --generate-notes
7654
env:
7755
GH_TOKEN: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
56+
{%- if enable_pypi %}
57+
58+
publish:
59+
name: Publish to PyPI
60+
needs: build
61+
runs-on: ubuntu-latest
62+
environment:
63+
name: pypi
64+
url: https://pypi.org/project/{{ project_name }}/
65+
permissions:
66+
id-token: write
67+
attestations: write
68+
steps:
69+
- name: 🔽 Download artifact
70+
uses: actions/download-artifact@v8
71+
with:
72+
name: dist
73+
path: dist/
74+
75+
- name: ☢️ Publish to PyPI
76+
uses: pypa/gh-action-pypi-publish@release/v1
77+
with:
78+
attestations: true
79+
{%- endif %}
7880
{#- vim: set ft=yaml: #}

0 commit comments

Comments
 (0)