-
Notifications
You must be signed in to change notification settings - Fork 6
53 lines (46 loc) · 1.15 KB
/
release-pypi.yaml
File metadata and controls
53 lines (46 loc) · 1.15 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
name: PyPI Release
on:
push:
tags:
- v*.*.*
permissions: {}
jobs:
build:
name: Build and verify package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0 # setuptools_scm needs tags
- name: Verify tag points at a commit on main
run: |
git fetch origin main
git merge-base --is-ancestor "$GITHUB_SHA" origin/main \
|| { echo "Tag $GITHUB_REF_NAME is not on main"; exit 1; }
- uses: ./.github/actions/build-package
release:
name: Create GitHub release
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v6
- uses: softprops/action-gh-release@v3
with:
generate_release_notes: true
publish:
name: Publish to PyPI
needs: [build]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/${{ github.event.repository.name }}
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
name: Packages
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1