generated from thombashi/python-lib-project-template
-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (44 loc) · 1.12 KB
/
publish.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
name: Build and publish the new version to PyPI
on:
push:
tags:
- "v*.*.*"
jobs:
build-package:
runs-on: ubuntu-latest
container:
image: ghcr.io/thombashi/python-ci:3.11
steps:
- uses: actions/checkout@v4
- run: make build
- uses: actions/upload-artifact@v4
with:
name: dist
path: ./dist/*
publish-package:
needs: build-package
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/cleanpy
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: dist
path: ./dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Generate a GitHub release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: dist/*