-
Notifications
You must be signed in to change notification settings - Fork 1
181 lines (174 loc) · 5.98 KB
/
automaticRelease.yaml
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
name: automatic-release
on:
push:
branches:
- main
# schedule:
# # * is a special character in YAML so you have to quote this string
# - cron: '0 0 * * 6'
jobs:
zip-rules:
name: zip up the rules directory
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build Rust Library
run: |
cargo build --target x86_64-unknown-linux-gnu # doesn't need a release build since all that we want is the Rules dir
- name: create rules.zip
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: 'Rules.zip'
directory: 'addon/globalPlugins/MathCAT'
path: 'Rules'
- name: Upload Rules.zip
uses: actions/upload-artifact@v4
with:
name: 'Rules.zip'
path: 'addon/globalPlugins/MathCAT/Rules.zip'
compression-level: 0
retention-days: 1
rust-32-win:
name: Build 32 bit windows dll
runs-on: windows-latest # needs to run on windows because of bzip2
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build 32 bit version
run: cargo build --target i686-pc-windows-msvc --release
# HOW DO GET A 32 BIT GCC TO RUN?
# - name: Setup Example dir and test build
# run: |
# cp target/i686-pc-windows-msvc/release/libmathcat_c.dll Example/
# cd Example
# gcc -m32 test.cpp -o test -L. -llibmathcat_c
# ./test.exe
# gcc test.c -o test -L. -llibmathcat_c
# ./test.exe
- name: create zip file for dll file -- this allows the name to indicate arch, python version, etc., but unzipped it is correctly named
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: '../libmathcat_c.dll-32-win.zip'
directory: 'Example'
path: 'libmathcat_c.dll'
- name: Upload 32 bit pyd file
uses: actions/upload-artifact@v4
with:
name: libmathcat_c.dll-32-win.zip
path: libmathcat_c.dll-32-win.zip
compression-level: 0
retention-days: 1
- name: Upload Example Dir
uses: actions/upload-artifact@v4
with:
name: Example
path: Example
compression-level: 0
retention-days: 1
rust-64-win:
name: Build 64 bit windows dll
runs-on: windows-latest # needs to run on windows because of bzip2
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build 64 bit version
run: cargo build --target x86_64-pc-windows-msvc --release
#
- name: Setup Example dir and test build
run: |
cp target/x86_64-pc-windows-msvc/release/libmathcat_c.dll Example/
cd Example
gcc test.cpp -o test -L. -llibmathcat_c
./test.exe
gcc test.c -o test -L. -llibmathcat_c
./test.exe
- name: create zip file for dll file -- this allows the name to indicate arch, python version, etc., but unzipped it is correctly named
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: '../libmathcat_c.dll-64-win.zip'
directory: 'Example'
path: 'libmathcat_c.dll'
- name: Upload 64 bit pyd file
uses: actions/upload-artifact@v4
with:
name: libmathcat_c.dll-64-win.zip
path: libmathcat_c.dll-64-win.zip
compression-level: 0
retention-days: 1
rust-64-arm-win:
name: Build 64 bit arm windows dll
runs-on: windows-latest # needs to run on windows because of bzip2
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Build 64 bit version
run: |
rustup target add aarch64-pc-windows-msvc
cargo build --target aarch64-pc-windows-msvc --release
# HOW DO GET A ARM GCC TO RUN?
- name: Setup Example dir and test build
run: |
cp target/aarch64-pc-windows-msvc/release/libmathcat_c.dll Example/
cd Example
gcc test.cpp -o test -L. -llibmathcat_c
./test.exe
gcc test.c -o test -L. -llibmathcat_c
./test.exe
- name: create zip file for dll file -- this allows the name to indicate arch, python version, etc., but unzipped it is correctly named
uses: thedoctor0/[email protected]
with:
type: 'zip'
filename: '../libmathcat_c.dll-64-arm.zip'
directory: 'Example'
path: 'libmathcat_c.dll'
- name: Upload 64 bit pyd file
uses: actions/upload-artifact@v4
with:
name: libmathcat_c.dll-64-armn.zip
path: libmathcat_c.dll-64-arm.zip
compression-level: 0
retention-days: 1
pre-release:
name: Pre Release
continue-on-error: false
needs: [zip-rules, rust-32-win, rust-64-win, rust-64-arm-win]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
# download the previous build artifacts and put them in their proper places
- name: Download Rules.zip
uses: actions/download-artifact@v4
with:
name: Rules.zip
- name: Download Example Dir
uses: actions/download-artifact@v4
with:
name: Example
- name: Download 32 bit build
uses: actions/download-artifact@v4
with:
name: libmathcat_c.dll-32-win.zip
- name: Download 64 bit build
uses: actions/download-artifact@v4
with:
name: libmathcat_c.dll-64-win.zip
- name: Download 64 bit linux build
uses: actions/download-artifact@v4
with:
name: libmathcat_c.dll-64-armn.zip
- name: Automatic release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: true
title: Development Build
files: |
libmathcat*.zip
Rules.zip
Example