-
Notifications
You must be signed in to change notification settings - Fork 24
209 lines (201 loc) · 8.59 KB
/
build-release.yml
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
name: build-release
env:
ai_s3_endpoint: ${{ secrets.AI_S3_ENDPOINT }}
ai_s3_access_key: ${{ secrets.AI_S3_ACCESS_KEY }}
ai_s3_secret_key: ${{ secrets.AI_S3_SECRET_KEY }}
ai_s3_bucket_name: ${{ secrets.AI_S3_BUCKET_NAME }}
ai_s3_bge_bucket_name: ${{ secrets.AI_S3_BGE_BUCKET_NAME }}
ai_s3_denoise_bucket_name: ${{ secrets.AI_S3_DENOISE_BUCKET_NAME }}
on:
push:
tags:
- "*.*.*"
jobs:
# build-linux-deb:
# runs-on: ubuntu-20.04
# steps:
# - name: setup python
# uses: actions/setup-python@v2
# with:
# python-version: '3.10'
# - name: checkout repository
# uses: actions/checkout@v3
# - name: configure ai s3 secrets
# run: |
# echo "endpoint = \"$ai_s3_endpoint\"" >> ./graxpert/s3_secrets.py && \
# echo "ro_access_key = \"$ai_s3_access_key\"" >> ./graxpert/s3_secrets.py && \
# echo "ro_secret_key = \"$ai_s3_secret_key\"" >> ./graxpert/s3_secrets.py && \
# echo "bucket_name = \"$ai_s3_bucket_name\"" >> ./graxpert/s3_secrets.py && \
# echo "bge_bucket_name = \"$ai_s3_bge_bucket_name\"" >> ./graxpert/s3_secrets.py && \
# echo "denoise_bucket_name = \"$ai_s3_denoise_bucket_name\"" >> ./graxpert/s3_secrets.py
# - name: install dependencies
# run: |
# sudo apt install alien -y && \
# pip install "cx_freeze" && \
# pip install onnxruntime-gpu && \
# pip install -r requirements.txt
# - name: patch version
# run: |
# chmod u+x ./releng/patch_version.sh && \
# ./releng/patch_version.sh
# - name: create GraXpert-linux bundle
# run: python ./setup.py bdist_deb
# - name: store artifacts
# uses: actions/upload-artifact@v2
# with:
# name: graxpert_${{github.ref_name}}-1_amd64.deb
# path: ./dist/graxpert_${{github.ref_name}}-1_amd64.deb
# retention-days: 5
build-linux-zip:
runs-on: ubuntu-20.04
steps:
- name: setup python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: checkout repository
uses: actions/checkout@v3
- name: configure ai s3 secrets
run: |
echo "endpoint = \"$ai_s3_endpoint\"" >> ./graxpert/s3_secrets.py && \
echo "ro_access_key = \"$ai_s3_access_key\"" >> ./graxpert/s3_secrets.py && \
echo "ro_secret_key = \"$ai_s3_secret_key\"" >> ./graxpert/s3_secrets.py && \
echo "bucket_name = \"$ai_s3_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "bge_bucket_name = \"$ai_s3_bge_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "denoise_bucket_name = \"$ai_s3_denoise_bucket_name\"" >> ./graxpert/s3_secrets.py
- name: install dependencies
run: |
pip install setuptools wheel cx_freeze && \
pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/ && \
pip install -r requirements.txt
- name: patch version
run: |
chmod u+x ./releng/patch_version.sh && \
./releng/patch_version.sh
- name: create GraXpert-linux bundle
run: python ./setup.py install_exe --install-dir=./dist/GraXpert-linux
- name: zip GraXpert-linux bundle
run: |
cd ./dist && \
zip -r ./GraXpert-linux.zip ./GraXpert-linux
- name: store artifacts
uses: actions/upload-artifact@v2
with:
name: GraXpert-linux.zip
path: ./dist/GraXpert-linux.zip
retention-days: 5
build-windows:
runs-on: windows-latest
steps:
- name: setup python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: checkout repository
uses: actions/checkout@v3
- name: configure ai s3 secrets
run: |
$PSDefaultParameterValues['Out-File:Encoding']='UTF8' ; `
"endpoint = `"$env:ai_s3_endpoint`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"ro_access_key = `"$env:ai_s3_access_key`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"ro_secret_key = `"$env:ai_s3_secret_key`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"bucket_name = `"$env:ai_s3_bucket_name`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"bge_bucket_name = `"$env:ai_s3_bge_bucket_name`"" | Out-File -Append .\graxpert\s3_secrets.py ; `
"denoise_bucket_name = `"$env:ai_s3_denoise_bucket_name`"" | Out-File -Append .\graxpert\s3_secrets.py
- name: install dependencies
run: |
pip install setuptools wheel cx_freeze; `
pip install onnxruntime-directml; `
pip install -r requirements.txt
- name: patch version
run: ./releng/patch_version.ps1
- name: create GraXpert-win64 bundle
run: python ./setup.py bdist_msi
- name: store artifacts
uses: actions/upload-artifact@v2
with:
name: GraXpert-${{github.ref_name}}-win64.msi
path: ./dist/GraXpert-${{github.ref_name}}-win64.msi
retention-days: 5
build-macos-x86_64:
runs-on: macos-11
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: configure ai s3 secrets
run: |
echo "endpoint = \"$ai_s3_endpoint\"" >> ./graxpert/s3_secrets.py && \
echo "ro_access_key = \"$ai_s3_access_key\"" >> ./graxpert/s3_secrets.py && \
echo "ro_secret_key = \"$ai_s3_secret_key\"" >> ./graxpert/s3_secrets.py && \
echo "bucket_name = \"$ai_s3_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "bge_bucket_name = \"$ai_s3_bge_bucket_name\"" >> ./graxpert/s3_secrets.py && \
echo "denoise_bucket_name = \"$ai_s3_denoise_bucket_name\"" >> ./graxpert/s3_secrets.py
# github actions overwrites brew's python. Force it to reassert itself, by running in a separate step.
- name: unbreak python in github actions
run: |
find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete
sudo rm -rf /Library/Frameworks/Python.framework/
brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3
- name: install dependencies
run: |
brew install python-tk && \
pip3 install setuptools wheel pyinstaller && \
pip3 install onnxruntime && \
pip3 install -r requirements.txt
- name: patch version
run: |
chmod u+x ./releng/patch_version.sh && \
./releng/patch_version.sh
- name: create GraXpert-macos-x86_64 bundle
# TODO migrato to cx_freeze
run: |
pyinstaller \
./GraXpert-macos-x86_64.spec
- name: install create-dmg
run: brew install create-dmg
- name: create .dmg
run: |
create-dmg \
--volname "GraXpert-macos-x86_64" \
--window-pos 50 50 \
--window-size 1920 1080 \
--icon-size 100 \
--icon "GraXpert.app" 200 190 \
--app-drop-link 400 190 \
"dist/GraXpert-macos-x86_64.dmg" \
"dist/GraXpert.app/"
- name: store artifacts
uses: actions/upload-artifact@v2
with:
name: GraXpert-macos-x86_64.dmg
path: ./dist/GraXpert-macos-x86_64.dmg
retention-days: 5
release:
runs-on: ubuntu-latest
# needs: [build-linux-deb, build-linux-zip, build-windows, build-macos-x86_64]
needs: [build-linux-zip, build-windows, build-macos-x86_64]
steps:
# - name: download linux deb
# uses: actions/download-artifact@v2
# with:
# name: graxpert_${{github.ref_name}}-1_amd64.deb
- name: download linux zip
uses: actions/download-artifact@v2
with:
name: GraXpert-linux.zip
- name: download windows exe
uses: actions/download-artifact@v2
with:
name: GraXpert-${{github.ref_name}}-win64.msi
- name: download macos artifacts
uses: actions/download-artifact@v2
with:
name: GraXpert-macos-x86_64.dmg
- name: create release
uses: softprops/action-gh-release@v1
with:
files: |
GraXpert-linux.zip
GraXpert-${{github.ref_name}}-win64.msi
GraXpert-macos-x86_64.dmg
# graxpert_${{github.ref_name}}-1_amd64.deb