@@ -3,10 +3,10 @@ name: release
3
3
on :
4
4
release :
5
5
types : [published]
6
+ workflow_dispatch :
6
7
7
8
jobs :
8
9
goreleaser :
9
- if : github.repository == 'tensorchord/envd'
10
10
runs-on : ubuntu-latest
11
11
steps :
12
12
- name : Checkout
17
17
uses : actions/setup-go@v5
18
18
with :
19
19
go-version : ' stable'
20
- - name : Docker Login
20
+ - name : Login to Docker
21
21
uses : docker/login-action@v3
22
22
with :
23
23
username : ${{ secrets.DOCKERIO_USERNAME }}
@@ -39,56 +39,72 @@ jobs:
39
39
dist/envd_linux_amd64_v1/envd
40
40
dist/envd_darwin_all/envd
41
41
if-no-files-found : error
42
- pypi_publish :
42
+ python_build :
43
43
needs : goreleaser
44
- # only trigger on main repo when tag starts with v
45
- if : github.repository == 'tensorchord/envd' && startsWith(github.ref, 'refs/tags/v')
46
44
runs-on : ${{ matrix.os }}
47
- timeout-minutes : 20
48
- permissions :
49
- id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
50
45
strategy :
51
46
matrix :
52
47
os : [macos-13, ubuntu-22.04]
53
48
steps :
54
- - uses : actions/checkout@v4
55
- - name : Get gobin
56
- uses : actions/download-artifact@v4
57
- with :
58
- name : gobin_${{ github.event.release.tag_name }}
59
- path : dist/
60
- - name : Configure linux build environment
61
- if : runner.os == 'Linux'
62
- run : |
63
- mkdir -p bin
64
- mv dist/envd_linux_amd64_v1/envd bin/envd
65
- chmod +x bin/envd
66
- - name : Configure macOS build environment
67
- if : runner.os == 'macOS'
68
- run : |
69
- mkdir -p bin
70
- mv dist/envd_darwin_all/envd bin/envd
71
- chmod +x bin/envd
72
- - name : setup Python
73
- uses : actions/setup-python@v5
74
- with :
75
- python-version : ' 3.11'
76
- - name : Build wheels
77
- uses : pypa/cibuildwheel@v2.22.0
78
- env :
79
- CIBW_ARCHS_MACOS : arm64, x86_64
80
- CIBW_ARCHS_LINUX : auto64
81
- CIBW_SKIP : pp*
82
- - name : Build source distribution
83
- if : runner.os == 'Linux' # Only release source under linux to avoid conflict
84
- run : |
85
- python -m pip install wheel
86
- python setup.py sdist
87
- mv dist/*.tar.gz wheelhouse/
88
- - name : Publish package distributions to PyPI
89
- run : |
90
- python -m pip install twine
91
- python -m twine upload --skip-existing wheelhouse/*
49
+ - uses : actions/checkout@v4
50
+ - name : Get gobin
51
+ uses : actions/download-artifact@v4
52
+ with :
53
+ name : gobin_${{ github.event.release.tag_name }}
54
+ path : dist/
55
+ - name : Configure linux build environment
56
+ if : runner.os == 'Linux'
57
+ run : |
58
+ mkdir -p bin
59
+ mv dist/envd_linux_amd64_v1/envd bin/envd
60
+ chmod +x bin/envd
61
+ - name : Configure macOS build environment
62
+ if : runner.os == 'macOS'
63
+ run : |
64
+ mkdir -p bin
65
+ mv dist/envd_darwin_all/envd bin/envd
66
+ chmod +x bin/envd
67
+ - name : setup Python
68
+ uses : actions/setup-python@v5
69
+ with :
70
+ python-version : ' 3.11'
71
+ - name : Build wheels
72
+ uses : pypa/cibuildwheel@v2.22.0
73
+ env :
74
+ CIBW_ARCHS_MACOS : arm64, x86_64
75
+ CIBW_ARCHS_LINUX : auto64
76
+ CIBW_SKIP : pp*
77
+ - name : Build source distribution
78
+ if : runner.os == 'Linux' # Only release source under linux to avoid conflict
79
+ run : |
80
+ python -m pip install wheel
81
+ python setup.py sdist
82
+ mv dist/*.tar.gz wheelhouse/
83
+ - name : Upload artifacts
84
+ uses : actions/upload-artifact@v4
85
+ with :
86
+ name : pypi_${{ github.event.release.tag_name }}_${{ matrix.os }}
87
+ path : wheelhouse/
88
+ retention-days : 1
89
+ pypi_publish :
90
+ needs : python_build
91
+ # only trigger on main repo when tag starts with v
92
+ if : github.repository == 'tensorchord/envd' && startsWith(github.ref, 'refs/tags/v')
93
+ runs-on : ubuntu-24.04
94
+ permissions :
95
+ id-token : write # IMPORTANT: this permission is mandatory for trusted publishing
96
+ steps :
97
+ - name : Download artifacts
98
+ uses : actions/download-artifact@v4
99
+ with :
100
+ pattern : pypi_${{ github.event.release.tag_name }}_*
101
+ merge-multiple : true
102
+ path : dist/
103
+ - name : Upload to PyPI
104
+ uses : pypa/gh-action-pypi-publish@release/v1
105
+ with :
106
+ skip-existing : true
107
+ verbose : true
92
108
image_publish :
93
109
name : Build & push images
94
110
# only trigger on main repo when tag starts with v
@@ -118,6 +134,8 @@ jobs:
118
134
envd_starship_publish :
119
135
name : Push starship image to Docker Hub
120
136
runs-on : ubuntu-latest
137
+ # only trigger on main repo when tag starts with v
138
+ if : github.repository == 'tensorchord/envd' && startsWith(github.ref, 'refs/tags/v')
121
139
needs : goreleaser
122
140
steps :
123
141
- uses : actions/checkout@v4
@@ -177,10 +195,6 @@ jobs:
177
195
tag_suffix : " "
178
196
- build_func : build_gpu_11_6
179
197
tag_suffix : " -cuda-11.6.2-cudnn-8"
180
- - build_func : build_gpu_11_8
181
- tag_suffix : " -cuda-11.8.0-cudnn-8"
182
- - build_func : build_gpu_12_3
183
- tag_suffix : " -cuda-12.3.2-cudnn-9"
184
198
needs : image_publish
185
199
steps :
186
200
- uses : actions/checkout@v4
0 commit comments