-
Notifications
You must be signed in to change notification settings - Fork 75
72 lines (63 loc) · 1.73 KB
/
Copy pathwheels.yml
File metadata and controls
72 lines (63 loc) · 1.73 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
71
72
name: Python wheels
on: # yamllint disable-line rule:truthy
push:
tags:
- 'v*.*.*'
workflow_dispatch:
inputs:
publish-pypi:
description: 'Publish to PyPI'
required: false
type: boolean
default: false
jobs:
build:
uses: ./.github/workflows/test_python.yml
publish-pypi:
# TODO: create GitHub environment
# environment:
# name: pypi
# url: https://pypi.org/project/mutationpp
needs: [build]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: Download sdist artifact
uses: actions/download-artifact@v8
with:
path: dist
pattern: sdist
merge-multiple: true
- name: Download wheel artifacts
uses: actions/download-artifact@v8
with:
path: dist
pattern: wheel-*
merge-multiple: true
- name: Checksum artifacts
run: |
sha256sum -b *
echo '```' >> "$GITHUB_STEP_SUMMARY"
sha256sum -b * >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
working-directory: dist
- if: |
inputs.publish-pypi ||
github.ref_type == 'tag'
name: Attest artifacts
uses: actions/attest-build-provenance@v4
with:
subject-path: dist/*
- if: |
inputs.publish-pypi ||
github.ref_type == 'tag'
name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
# TODO: remove next line to use the main PyPI index
repository-url: https://test.pypi.org/legacy/
# TODO: setup Trusted Publising on PyPI, then remove next line
password: ${{ secrets.TESTPYPI_TOKEN }}