1
- name : Build Wheels
1
+ name : Build and Publish Wheels
2
2
3
3
on :
4
- push :
5
- branches : [ master ]
6
- tags :
7
- - ' v* '
8
- pull_request :
9
- branches : [ master ]
4
+ workflow_dispatch :
5
+
6
+ env :
7
+ DOMAIN : poolside
8
+ REPOSITORY : poolside-dagster
9
+ WHEEL_DST : /tmp/sp_wheelhouse
10
10
11
11
jobs :
12
12
build_wheels :
13
- outputs :
14
- digests-linux : ${{ steps.hash-linux.outputs.digests }}
15
- digests-macos : ${{ steps.hash-macos.outputs.digests }}
16
- digests-windows : ${{ steps.hash-windows.outputs.digests }}
17
13
strategy :
18
14
matrix :
19
- os : [ubuntu-latest, windows-latest, macOS-11 ]
15
+ os : [ubuntu-latest, macOS-latest ]
20
16
runs-on : ${{ matrix.os }}
21
17
name : Build wheels on ${{ matrix.os }}
22
18
19
+ permissions :
20
+ id-token : write # This is required for requesting the JWT
21
+ contents : read # This is required for actions/checkout
22
+
23
23
steps :
24
- - uses : actions/checkout@v3
25
- - uses : actions/setup-python@v4
24
+ - uses : actions/checkout@v4
25
+ - uses : actions/setup-python@v5
26
26
with :
27
- python-version : " 3.x "
27
+ python-version : " 3.12 "
28
28
29
29
- name : Set up QEMU
30
30
if : runner.os == 'Linux'
31
- uses : docker/setup-qemu-action@v2
31
+ uses : docker/setup-qemu-action@v3
32
32
with :
33
33
platforms : arm64
34
34
35
- - name : Build for Windows
36
- if : runner.os == 'Windows'
35
+ - name : Configure AWS Credentials
36
+ uses : aws-actions/configure-aws-credentials@v4
37
+ with :
38
+ role-to-assume : arn:aws:iam::939990436136:role/gh-action-publish-artifacts-role
39
+ aws-region : us-east-1
40
+
41
+ - name : Make sure destination dir exists
37
42
run : |
38
- cmake -A Win32 -B ${{github.workspace}}/build_win32 -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/root_win32
39
- cmake --build ${{github.workspace}}/build_win32 --config Release --target install --parallel 8
40
- cmake -A x64 -B ${{github.workspace}}/build_amd64 -DSPM_ENABLE_SHARED=OFF -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/root_amd64
41
- cmake --build ${{github.workspace}}/build_amd64 --config Release --target install --parallel 8
43
+ mkdir -p ${{env.WHEEL_DST}}
44
+ if [ ! -d ${{env.WHEEL_DST}} ]; then
45
+ echo "wheel dest dir does not exist!"
46
+ exit 1
47
+ fi
42
48
43
49
- name : Build for Mac
44
50
if : runner.os == 'macOS'
@@ -47,101 +53,39 @@ jobs:
47
53
cmake --build ${{github.workspace}}/build --config Release --target install --parallel 8
48
54
env :
49
55
CMAKE_OSX_ARCHITECTURES : arm64;x86_64
56
+ MACOSX_DEPLOYMENT_TARGET : 10.13
50
57
51
- - name : Install cibuildwheel
58
+ - name : Install dependencies
52
59
working-directory : ${{github.workspace}}/python
53
60
run : |
54
61
python -m pip install --upgrade pip
55
- pip install setuptools wheel twine
56
- python -m pip install cibuildwheel==2.12.0
62
+ pip install setuptools wheel twine build cibuildwheel
57
63
58
64
- name : Build wheels
59
65
working-directory : ${{github.workspace}}/python
60
- run : python -m cibuildwheel --output-dir wheelhouse
66
+ run : python -m cibuildwheel --output-dir ${{env.WHEEL_DST}}
61
67
env :
68
+ CIBW_BUILD : " cp311-* cp312-*"
62
69
CIBW_ARCHS_LINUX : auto aarch64
63
70
CIBW_ARCHS_MACOS : x86_64 universal2 arm64
64
- CIBW_SKIP : " pp* *-musllinux_*"
71
+ CIBW_ARCHS_WINDOWS : auto ARM64
72
+ CIBW_SKIP : " pp* *-musllinux_* *i686*"
65
73
CIBW_BUILD_VERBOSITY : 1
66
74
67
75
- name : Build sdist archive
68
76
working-directory : ${{github.workspace}}/python
69
77
run : sh build_sdist.sh
70
78
71
79
- name : Fetch sdist archive
72
- uses : tj-actions/glob@v17
80
+ uses : tj-actions/glob@2944188f585a0ec102a6a82d9eeb3aed69785393 # v22.0.1
73
81
id : sdist
74
82
with :
75
83
files : ./python/dist/*.tar.gz
76
-
84
+
77
85
- name : Build wheel from sdist
78
- run : python -m pip wheel "${{ steps.sdist.outputs.paths }}" --verbose
79
-
80
- - name : Copy sdist
81
- working-directory : ${{github.workspace}}/python
82
- if : runner.os == 'macOS'
83
- run : cp -f dist/*.tar.gz wheelhouse/
84
-
85
- - name : Upload artifact
86
- uses : actions/upload-artifact@v3
87
- with :
88
- path : |
89
- ./python/wheelhouse/*.whl
90
- ./python/wheelhouse/*.tar.gz
91
-
92
- - name : Upload wheel release
93
- if : startsWith(github.ref, 'refs/tags/')
94
- uses : svenstaro/upload-release-action@v2
95
- with :
96
- repo_token : ${{ secrets.GITHUB_TOKEN }}
97
- file : ./python/wheelhouse/*
98
- tag : ${{ github.ref }}
99
- overwrite : true
100
- prerelease : true
101
- file_glob : true
102
-
103
- - name : Generate SLSA subjects - Macos
104
- id : hash-macos
105
- if : runner.os == 'macOS'
106
- run : echo "digests=$(shasum -a 256 ./python/wheelhouse/* | base64)" >> $GITHUB_OUTPUT
107
-
108
- - name : Generate SLSA subjects - Linux
109
- id : hash-linux
110
- if : runner.os == 'Linux'
111
- run : echo "digests=$(sha256sum ./python/wheelhouse/* | base64 -w0)" >> $GITHUB_OUTPUT
112
-
113
- - name : Generate SLSA subjects - Windows
114
- id : hash-windows
115
- if : runner.os == 'Windows'
116
- run : echo "digests=$(sha256sum ./python/wheelhouse/* | base64 -w0)" >> $GITHUB_OUTPUT
117
-
118
- gather-disgests :
119
- needs : [build_wheels]
120
- outputs :
121
- digests : ${{ steps.hash.outputs.digests }}
122
- runs-on : ubuntu-latest
123
- steps :
124
- - name : Merge results
125
- id : hash
126
- env :
127
- LINUX_DIGESTS : " ${{ needs.build_wheels.outputs.digests-linux }}"
128
- MACOS_DIGESTS : " ${{ needs.build_wheels.outputs.digests-macos }}"
129
- WINDOWS_DIGESTS : " ${{ needs.build_wheels.outputs.digests-windows }}"
86
+ run : python -m pip wheel "${{ steps.sdist.outputs.paths }}" --wheel-dir ${{env.WHEEL_DST}} --verbose
87
+
88
+ - name : Publish
130
89
run : |
131
- set -euo pipefail
132
- echo "$LINUX_DIGESTS" | base64 -d > checksums.txt
133
- echo "$MACOS_DIGESTS" | base64 -d >> checksums.txt
134
- echo "$WINDOWS_DIGESTS" | base64 -d >> checksums.txt
135
- echo "digests=$(cat checksums.txt | base64 -w0)" >> $GITHUB_OUTPUT
136
-
137
- provenance :
138
- if : startsWith(github.ref, 'refs/tags/')
139
- needs : [build_wheels, gather-disgests]
140
- permissions :
141
- actions : read # To read the workflow path.
142
- id-token : write # To sign the provenance.
143
- contents : write # To add assets to a release.
144
- uses :
slsa-framework/slsa-github-generator/.github/workflows/[email protected]
145
- with :
146
- base64-subjects : " ${{ needs.gather-disgests.outputs.digests }}"
147
- upload-assets : true # Optional: Upload to a new release
90
+ aws codeartifact login --tool twine --domain ${{env.DOMAIN}} --repository ${{ env.REPOSITORY }}
91
+ twine upload --verbose --repository codeartifact ${{env.WHEEL_DST}}/*
0 commit comments