-
Notifications
You must be signed in to change notification settings - Fork 25
112 lines (94 loc) · 3.39 KB
/
publish.yml
File metadata and controls
112 lines (94 loc) · 3.39 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Publish scipy_openblasN wheels
on:
workflow_dispatch:
inputs:
environment:
description: |
Which PyPI environment to upload to?
Be sure to push an annotated tag to 'main' before choosing 'pypi'
required: true
type: choice
options: [ "none", "testpypi", "pypi" ]
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
# -------------------------------------------------------------------------------------
# Workflows to build wheels
call-posix:
uses: ./.github/workflows/posix.yml
with:
publish: true
call-windows:
uses: ./.github/workflows/windows.yml
call-windows-arm:
uses: ./.github/workflows/windows-arm.yml
# -------------------------------------------------------------------------------------
check-version:
name: Ensure commit is tag before upload to PyPi
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi'
runs-on: ubuntu-latest
steps:
- name: Checkout openblas-libs
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
fetch-tags: true
submodules: true
persist-credentials: false
- name: Examine git commit
run: |
if [ -n "$(git tag --points-at HEAD)" ]; then
echo "Current HEAD is tagged."
else
echo "Current HEAD is not tagged."
exit 1
fi
test_pypi-publish:
strategy:
matrix:
project: ["scipy-openblas32", "scipy-openblas64"]
name: Publish ${{ matrix.project }} to TestPyPI
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'testpypi'
needs: [call-posix, call-windows, call-windows-arm]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/project/${{ matrix.project }}/
permissions:
id-token: write # mandatory for trusted publishing
steps:
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
# I think the run-id for call-posix, call-windows, call-windows-arm should all be the same
run-id: ${{ needs.call-posix.outputs.run_id }}
pattern: wheels-*
merge-multiple: true
path: dist
- name: Publish
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
print-hash: true
attestations: true
pypi-publish:
name: Publish scipy-openblas to PyPI
if: github.event_name == 'workflow_dispatch' && github.event.inputs.environment == 'pypi'
needs: [call-posix, call-windows, call-windows-arm, check-version]
runs-on: ubuntu-latest
environment:
name: pypi
permissions:
id-token: write # mandatory for trusted publishing
steps:
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
run-id: ${{ needs.call-posix.outputs.run_id }}
pattern: wheels-*
merge-multiple: true
path: dist
- name: Publish
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
print-hash: true
attestations: true