-
Notifications
You must be signed in to change notification settings - Fork 26
121 lines (100 loc) · 3.52 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
on:
release:
types: [published]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
id-token: write # This is required for requesting the JWT
jobs:
test:
name: Test
secrets: inherit
permissions:
contents: read # to fetch code (actions/checkout)
id-token: write # This is required for requesting the JWT
uses: ./.github/workflows/test.yml
build:
name: Build distribution 📦
secrets: inherit
permissions:
contents: read # to fetch code (actions/checkout)
id-token: write # This is required for requesting the JWT
uses: ./.github/workflows/build.yml
publish-to-testpypi:
# Test PyPI publish, requires wheels and source dist to pass
name: >-
Publish Python 🐍 distribution 📦 to TestPyPI
needs: [test, build]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/ark-analysis
permissions:
contents: read # to fetch code (actions/checkout)
id-token: write # Necessary for trusted publishing
steps:
- name: Download Built Distributions 📦
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish distributions 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1.9
with:
repository-url: https://test.pypi.org/legacy/
publish-to-pypi:
# PyPI publish requires test, wheels, source dist, and testpypi to pass
name: >-
Publish Python 🐍 Distributions 📦 to PyPI
needs: [test, build, publish-to-testpypi]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/ark-analysis
permissions:
contents: read # to fetch code (actions/checkout)
id-token: write # Necessary for trusted publishing
# Publish when a GitHub Release is created, use the following rule:
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- name: Download Built Distributions 📦
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish Distributions 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1.9
github-release-upload-dists:
name: >-
Sign the Python 🐍 distribution 📦 with Sigstore
and upload them to the GitHub Release
needs: [test, build, publish-to-testpypi, publish-to-pypi]
runs-on: ubuntu-latest
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
steps:
- name: Download Built Distributions 📦
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'