-
Notifications
You must be signed in to change notification settings - Fork 77
54 lines (45 loc) · 1.33 KB
/
publish-to-pypi.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
# This workflow will run when a new release is published and upload it to PyPI using trusted publishing.
# Done in two separate build and publish jobs per suggested best practice for limiting scope of token usage.
name: Publish - PyPI
on:
release:
types:
- published
jobs:
build:
if: ${{ github.repository == 'slaclab/pydm' }}
name: Build new release
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build Package
run: python setup.py sdist
- name: Upload package
uses: actions/upload-artifact@v3
with:
name: package
path: dist/*
retention-days: 1
publish:
if: ${{ github.repository == 'slaclab/pydm' }}
name: Publish release to PyPI
runs-on: ubuntu-latest
permissions:
id-token: write # Used for trusted publishing
steps:
- name: Download package
uses: actions/[email protected]
with:
name: package
path: dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1