-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (65 loc) · 2.14 KB
/
release-pypi.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
name: Release
on:
workflow_run:
workflows: [build]
branches: [main]
types:
- completed
jobs:
github-release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && startsWith(github.event.workflow_run.head_commit.message, 'chore(release):') }}
environment:
name: release
permissions:
contents: write
id-token: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Download all the dists
uses: actions/download-artifact@v4
with:
run-id: ${{ github.event.workflow_run.id }}
name: package-distributions
github-token: ${{ secrets.RELEASE_TOKEN }}
path: dist/
- name: Sign the dists
uses: sigstore/[email protected]
with:
upload-signing-artifacts: true
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Get Version
id: ver
run: echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
- name: Create Github Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
v${{ steps.ver.outputs.version }}
-t ${{ steps.ver.outputs.version }}
--repo '${{ github.repository }}'
--notes-file ./CHANGELOG.md
dist/**
publish-to-pypi:
name: Publish Python distribution to PyPI
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && startsWith(github.event.workflow_run.head_commit.message, 'chore(release):') }}
environment:
name: release
url: https://pypi.org/p/run-time-assurance
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
run-id: ${{ github.event.workflow_run.id }}
name: package-distributions
github-token: ${{ secrets.RELEASE_TOKEN }}
path: dist/
- name: Publish to PyPI
uses: pypa/[email protected]