-
Notifications
You must be signed in to change notification settings - Fork 7
56 lines (53 loc) · 1.63 KB
/
Copy pathdeploy.yml
File metadata and controls
56 lines (53 loc) · 1.63 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
name: deploy
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+"
workflow_dispatch:
env:
PYTHON_VERSION: "3.13"
jobs:
deploy-pypi:
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Build
run: |
pip install build
python -m build --wheel
- name: Publish package to TestPyPI
if: ${{ contains(github.ref, 'rc') }}
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
attestations: false
- name: Publish package to PyPI
if: ${{ !contains(github.ref, 'rc') }}
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
with:
verbose: true
attestations: false
release:
name: Create release
runs-on: ubuntu-latest
needs:
- deploy-pypi
permissions:
contents: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
- uses: softprops/action-gh-release@718ea10b132b3b2eba29c1007bb80653f286566b # v3
with:
name: spgrep ${{ github.ref_name }}
prerelease: ${{ contains(github.ref, 'rc') }}
generate_release_notes: true