-
Notifications
You must be signed in to change notification settings - Fork 6
43 lines (37 loc) · 995 Bytes
/
release.yaml
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
name: Release
# Always tests wheel building, but only publish to PyPI on pushed tags.
on:
pull_request:
paths-ignore:
- ".github/workflows/*.yaml"
- "!.github/workflows/release.yaml"
push:
branches:
- "main"
tags: ["**"]
workflow_dispatch:
jobs:
build-release:
runs-on: ubuntu-22.04
permissions:
id-token: write
steps:
- uses: actions/checkout@v3
with:
# Fetch full history so we don't run into trouble with setuptools_scm
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: install build package
run: |
pip install --upgrade pip
pip install build
pip freeze
- name: build release
run: |
python -m build --sdist --wheel .
ls -l dist
- name: publish to pypi
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/')