-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (52 loc) · 1.54 KB
/
Copy pathpublish.yml
File metadata and controls
56 lines (52 loc) · 1.54 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: Publish
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions: {}
steps:
- uses: actions/checkout@a37ce9120846195fa4ece8f58b268e6043cb2f26
- uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c
with:
python-version: "3.x"
- name: Build package
run: |
python -m pip install --upgrade pip
pip install build
python -m build
- name: Upload package artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
with:
name: python-dist
path: dist/*
if-no-files-found: error
publish-pypi:
needs: build
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download package artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: python-dist
path: dist
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33
attach-release-assets:
needs: [build, publish-pypi]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download package artifacts
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093
with:
name: python-dist
path: dist
- name: Attach artifacts to release
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844
with:
files: dist/*