-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (66 loc) · 2.12 KB
/
Copy pathrelease.yml
File metadata and controls
70 lines (66 loc) · 2.12 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: release (build only - PyPI publishing deferred)
# PyPI trusted-publishing is deferred (see docs/TODO.md M8). For now this workflow:
# - does NOT run automatically (manual dispatch only), so tag pushes no longer
# trigger a failing publish;
# - builds + checks the sdist/wheel when dispatched manually;
# - keeps the TestPyPI / PyPI publish jobs commented out below as a TODO.
# To enable publishing: register the trusted publishers and the `testpypi` /
# `pypi` environments, switch the trigger to tags, and uncomment the jobs.
on:
workflow_dispatch:
jobs:
build:
name: Build sdist + wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Build
run: |
python -m pip install --upgrade build twine
python -m build
python -m twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
# TODO(publish): switch the trigger above to
# on:
# push:
# tags:
# - "v*"
# and uncomment the publish jobs below.
#
# testpypi:
# name: Publish to TestPyPI (pre-release tags)
# needs: build
# if: contains(github.ref_name, 'rc') || contains(github.ref_name, 'a') || contains(github.ref_name, 'b')
# runs-on: ubuntu-latest
# environment: testpypi
# permissions:
# id-token: write
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: dist
# path: dist/
# - uses: pypa/gh-action-pypi-publish@release/v1
# with:
# repository-url: https://test.pypi.org/legacy/
#
# pypi:
# name: Publish to PyPI (final tags)
# needs: build
# if: "!contains(github.ref_name, 'rc') && !contains(github.ref_name, 'a') && !contains(github.ref_name, 'b')"
# runs-on: ubuntu-latest
# environment: pypi
# permissions:
# id-token: write
# steps:
# - uses: actions/download-artifact@v4
# with:
# name: dist
# path: dist/
# - uses: pypa/gh-action-pypi-publish@release/v1