Skip to content

Commit 8274f22

Browse files
committed
split into more smaller jobs
1 parent ac2fb7e commit 8274f22

File tree

1 file changed

+105
-75
lines changed

1 file changed

+105
-75
lines changed

.github/workflows/automaticRelease.yaml

Lines changed: 105 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
name: automatic-release
2-
32
on:
43
push:
54
branches:
65
- main
7-
schedule:
8-
# * is a special character in YAML so you have to quote this string
9-
- cron: '0 0 * * 6'
6+
# schedule:
7+
# # * is a special character in YAML so you have to quote this string
8+
# - cron: '0 0 * * 6'
109

1110
jobs:
1211
l10n:
@@ -28,6 +27,64 @@ jobs:
2827
git push
2928
exit(0) # exiting with '1' for some reason, so force proper exit
3029
30+
zip-rules:
31+
name: zip up the rules director
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v3
36+
- name: create rules.zip
37+
uses: thedoctor0/zip-release@0.7.5
38+
with:
39+
type: 'zip'
40+
filename: 'Rules.zip'
41+
directory: 'addon/globalPlugins/MathCAT'
42+
path: 'Rules'
43+
- name: Upload Rules.zip
44+
uses: actions/upload-artifact@v4
45+
with:
46+
name: Rules.zip
47+
path: Rules.zip
48+
compression-level: 0
49+
retention-days: 1
50+
51+
rust-32:
52+
name: Build 32 bit windows pyd file
53+
runs-on: windows-latest # needs to run on windows because of bzip2
54+
steps:
55+
- name: Checkout code
56+
uses: actions/checkout@v3
57+
- name: Set up Python
58+
uses: actions/setup-python@v5
59+
with:
60+
python-version: 3.11
61+
architecture: '86'
62+
- name: Build Rust Library
63+
run: |
64+
cargo build --target x86_32-pc-windows-msvc --release
65+
- name: Setup Example dir
66+
run: |
67+
cp target/x86_32-pc-windows-msvc/release/libmathcat_py.dll Example/libmathcat_py.pyd
68+
mv addon/globalPlugins/MathCAT/Rules Example
69+
- name: test the build
70+
run: |
71+
cd Example
72+
python test.py
73+
- name: create zip file for pyd file -- this allows the name to indicate arch, python version, etc., but unzipped it is correctly named
74+
uses: thedoctor0/zip-release@0.7.5
75+
with:
76+
type: 'zip'
77+
filename: '../libmathcat_py-32-3.11-win.zip'
78+
directory: 'Example'
79+
path: 'libmathcat_py.pyd'
80+
- name: Upload 32 bit pyd file
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: libmathcat_py-32-3.11-win.zip
84+
path: libmathcat_py-32-3.11-win.zip
85+
compression-level: 0
86+
retention-days: 1
87+
3188
rust-64:
3289
name: Build 64 bit windows pyd file
3390
runs-on: windows-latest # needs to run on windows because of bzip2
@@ -45,23 +102,15 @@ jobs:
45102
- name: Setup Example dir
46103
run: |
47104
cp target/x86_64-pc-windows-msvc/release/libmathcat_py.dll Example/libmathcat_py.pyd
48-
cp -r addon/globalPlugins/MathCAT/Rules Example
49-
- name: create rules.zip
50-
uses: thedoctor0/zip-release@0.7.5
51-
with:
52-
type: 'zip'
53-
filename: '../Rules.zip'
54-
directory: 'Example'
55-
path: 'Rules'
105+
mv addon/globalPlugins/MathCAT/Rules Example
56106
- name: create zip file for pyd file -- this allows the name to indicate arch, python version, etc., but unzipped it is correctly named
57107
uses: thedoctor0/zip-release@0.7.5
58108
with:
59109
type: 'zip'
60110
filename: '../libmathcat_py-64-3.11-win.zip'
61111
directory: 'Example'
62112
path: 'libmathcat_py.pyd'
63-
# build the test after zipping up "Rules" because the test will unzip the files needed for the test
64-
- name: test build
113+
- name: test the build
65114
run: |
66115
cd Example
67116
python test.py
@@ -72,46 +121,7 @@ jobs:
72121
path: libmathcat_py-64-3.11-win.zip
73122
compression-level: 0
74123
retention-days: 1
75-
- name: Upload Rules.zip
76-
uses: actions/upload-artifact@v4
77-
with:
78-
name: Rules.zip
79-
path: Rules.zip
80-
compression-level: 0
81-
retention-days: 1
82-
83-
rust-32:
84-
name: build addon (and 32-bit windows pyd file)
85-
runs-on: windows-latest # needs to run on windows because no 32-bit python on linux
86-
steps:
87-
- name: Checkout code
88-
uses: actions/checkout@v3
89-
- name: Set up Python
90-
uses: actions/setup-python@v5
91-
with:
92-
python-version: 3.11
93-
architecture: 'x86'
94-
- name: Build Rust Library
95-
run: cargo build --target i686-pc-windows-msvc --release
96-
- name: Setup Example dir
97-
run: |
98-
cp target/i686-pc-windows-msvc/release/libmathcat_py.dll Example/libmathcat_py.pyd
99-
cp -r addon/globalPlugins/MathCAT/Rules Example
100-
- name: test build
101-
run: |
102-
cd Example
103-
python test.py
104-
- name: Set up addons dir
105-
run: |
106-
cp target/i686-pc-windows-msvc/release/libmathcat_py.dll addon/globalPlugins/MathCAT/libmathcat_py.pyd
107-
sed 's/^import wx\.xrc/# import wx.xrc/' --in-place "addon/globalPlugins/MathCAT/MathCATgui.py" # fix wx file
108-
- name: Upload addons dir to use with scons
109-
uses: actions/upload-artifact@v4
110-
with:
111-
name: MathCAT_addons
112-
path: addon/globalPlugins
113-
retention-days: 1
114-
124+
115125
linux-64:
116126
name: Build linux pyd file (64-bit intel)
117127
runs-on: ubuntu-latest
@@ -150,57 +160,77 @@ jobs:
150160
compression-level: 0
151161
retention-days: 1
152162

153-
154-
pre-release:
163+
build-addon:
155164
name: Pre Release
156165
continue-on-error: false
157166
needs: [l10n, rust-64, rust-32, linux-64]
158167
runs-on: ubuntu-latest
159168
steps:
160169
- name: Checkout code
161170
uses: actions/checkout@v3
171+
# download the 32 build
172+
- name: Download 32 bit build
173+
uses: actions/download-artifact@v4
174+
with:
175+
name: libmathcat_py-32-3.11-win.zip
176+
# put things where they belong
177+
- name: Set up addons dir
178+
run: |
179+
unzip libmathcat_py-32-3.11-win.zip
180+
mv libmathcat_py.pyd addon/globalPlugins/MathCAT
181+
sed 's/^import wx\.xrc/# import wx.xrc/' --in-place "addon/globalPlugins/MathCAT/MathCATgui.py" # fix wx file
182+
# build the addon
162183
- name: Set up Python
163184
uses: actions/setup-python@v4
164185
with:
165186
python-version: 3.11 # needed for scons
166-
167187
- name: Install scons dependencies
168188
run: |
169189
pip install scons markdown
170190
sudo apt update
171191
sudo apt install gettext
172192
- name: Run scons to build .addon file
173193
run: |
174-
scons
175-
176-
# download the previous build artifacts and put them in their proper places
177-
- name: Download 64 bit build
178-
uses: actions/download-artifact@v4
194+
scons
195+
- name: Upload the addon
196+
uses: actions/upload-artifact@v4
179197
with:
180-
name: libmathcat_py-64-3.11-win.zip
198+
name: addon
199+
path: *.addon
200+
compression-level: 0
201+
retention-days: 1
202+
203+
pre-release:
204+
name: Pre Release
205+
continue-on-error: false
206+
needs: [rust-32, rust-64, linux-64, build-addon]
207+
runs-on: ubuntu-latest
208+
steps:
209+
- name: Checkout code
210+
uses: actions/checkout@v3
211+
212+
# download the previous build artifacts and put them in their proper places
181213
- name: Download Rules.zip
182214
uses: actions/download-artifact@v4
183215
with:
184216
name: Rules.zip
185-
- name: Download MathCAT addons dir
217+
- name: Download 32 bit build
186218
uses: actions/download-artifact@v4
187219
with:
188-
name: MathCAT_addons
189-
- shell: bash
190-
run: cp -r MathCAT addon/globalPlugins
191-
- name: create zip file for standalone pyd file -- this allows the name to indicate arch, python version, etc., but unzipped it is correctly named
192-
uses: thedoctor0/zip-release@0.7.5
220+
name: libmathcat_py-32-3.11-win.zip
221+
- name: Download 64 bit build
222+
uses: actions/download-artifact@v4
193223
with:
194-
type: 'zip'
195-
filename: '../../../libmathcat_py-32-3.11-win.zip'
196-
directory: 'addon/globalPlugins/MathCAT'
197-
path: 'libmathcat_py.pyd'
224+
name: libmathcat_py-64-3.11-win.zip
198225
- name: Download 64 bit linux build
199226
uses: actions/download-artifact@v4
200227
with:
201228
name: libmathcat_py-64-3.11-linux.zip
202-
203-
# finally, put the files into the release
229+
- name: download the addon
230+
uses: actions/download-artifact@v4
231+
with:
232+
name: addon
233+
# put the files into the release
204234
- name: Automatic release
205235
uses: marvinpinto/action-automatic-releases@latest
206236
with:

0 commit comments

Comments
 (0)