-
Notifications
You must be signed in to change notification settings - Fork 13
46 lines (44 loc) · 1.04 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
name: Build and publish
on:
push:
branches:
- main
tags:
- 'v*'
jobs:
build-and-publish:
name: Build and publish
runs-on: ubuntu-latest
permissions:
# Needed for PyPI publishing
id-token: write
# Needed for GitHub releases
contents: write
steps:
- name: Checkout source
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install build
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build package
run:
python -m build
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Make release on GitHub
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
dist/*.tar.gz
dist/*.whl
generate_release_notes: true
make_latest: true