forked from ask/mode
-
Notifications
You must be signed in to change notification settings - Fork 18
49 lines (41 loc) · 1.13 KB
/
publish.yml
File metadata and controls
49 lines (41 loc) · 1.13 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
name: Publish Package
on:
# Only run when release is created in the master branch
release:
types: [created]
branches:
- 'master'
jobs:
build:
name: Build distributable files
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout source repository'
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- name: Install build dependencies
run: pip install build twine
- name: 'Build package'
run: scripts/build.sh
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
path: 'dist/*'
upload_pypi:
name: Upload packages
needs: ['build']
runs-on: 'ubuntu-latest'
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: artifact
path: dist
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: '__token__'
password: '${{ secrets.PYPI_API_TOKEN }}'