-
Notifications
You must be signed in to change notification settings - Fork 15
71 lines (58 loc) · 1.69 KB
/
Copy pathrelease.yml
File metadata and controls
71 lines (58 loc) · 1.69 KB
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
name: Semantic Release
on:
push:
branches:
- master
jobs:
run_tests:
uses: ./.github/workflows/ci.yml
secrets: inherit
permissions:
contents: read
release:
needs: run_tests
if: github.ref_name == 'master'
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-release
cancel-in-progress: false
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.ref_name }}
- name: Reset to triggered commit
run: git reset --hard ${{ github.sha }}
- name: Python Semantic Release
id: release
uses: python-semantic-release/python-semantic-release@39dd2052f2ce8282a5d932c31d58a2ca06d2550e # v10.6.1
with:
git_committer_name: "github-actions[bot]"
git_committer_email: "github-actions[bot]@users.noreply.github.com"
changelog: "false"
- name: Upload dist artifacts
if: steps.release.outputs.released == 'true'
uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
outputs:
released: ${{ steps.release.outputs.released }}
version: ${{ steps.release.outputs.version }}
publish_to_pypi:
needs: release
if: needs.release.outputs.released == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Download dist artifacts
uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1