-
Notifications
You must be signed in to change notification settings - Fork 21
220 lines (199 loc) · 7.95 KB
/
mla_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
210
211
212
213
214
215
216
217
218
219
name: mla release
permissions:
contents: write
on:
push:
tags:
- "mla-v*"
env:
GITHUB_REF: "${{ github.ref }}"
jobs:
build:
strategy:
matrix:
build: [linux-x86_64, windows-i686, windows-x86_64, windows-i686-debug, windows-x86_64-debug]
include:
- build: linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-musl
cargo_arg: --release
path: |
./target/x86_64-unknown-linux-musl/release/libmla.a
- build: windows-i686
os: windows-latest
target: i686-pc-windows-msvc
msvc_platform: Win32
cargo_arg: --release
path: |
./target/i686-pc-windows-msvc/release/mla.lib
./target/i686-pc-windows-msvc/release/mla.dll
./target/i686-pc-windows-msvc/release/mla.dll.lib
./target/i686-pc-windows-msvc/release/mla.pdb
- build: windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
msvc_platform: x64
cargo_arg: --release
path: |
./target/x86_64-pc-windows-msvc/release/mla.lib
./target/x86_64-pc-windows-msvc/release/mla.dll
./target/x86_64-pc-windows-msvc/release/mla.dll.lib
./target/x86_64-pc-windows-msvc/release/mla.pdb
- build: windows-i686-debug
os: windows-latest
target: i686-pc-windows-msvc
msvc_platform: Win32
cargo_arg: ""
path: |
./target/i686-pc-windows-msvc/debug/mla.lib
./target/i686-pc-windows-msvc/debug/mla.dll
./target/i686-pc-windows-msvc/debug/mla.dll.lib
./target/i686-pc-windows-msvc/debug/mla.pdb
- build: windows-x86_64-debug
os: windows-latest
target: x86_64-pc-windows-msvc
msvc_platform: x64
cargo_arg: ""
path: |
./target/x86_64-pc-windows-msvc/debug/mla.lib
./target/x86_64-pc-windows-msvc/debug/mla.dll
./target/x86_64-pc-windows-msvc/debug/mla.dll.lib
./target/x86_64-pc-windows-msvc/debug/mla.pdb
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- uses: microsoft/[email protected]
if: matrix.msvc_platform
- name: Build static library
uses: actions-rs/cargo@v1
with:
command: build
args: ${{ matrix.cargo_arg }} --manifest-path=bindings/C/Cargo.toml --target=${{ matrix.target }}
- name: Upload resulting 'mla'
uses: actions/upload-artifact@v2
with:
name: mla-${{ matrix.build }}
path: ${{ matrix.path }}
release:
# From https://github.com/cloudflare/wrangler/blob/master/.github/workflows/release.yml
name: GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Query version number
id: get_version
shell: bash
run: |
echo "using version tag ${GITHUB_REF:15}"
echo "version=${GITHUB_REF:15}" >> $GITHUB_OUTPUT
- name: Checkout code
uses: actions/checkout@v2
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
path: ./mla/CHANGELOG.md
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: mla-${{ steps.get_version.outputs.VERSION }}
release_name: mla-${{ steps.get_version.outputs.VERSION }}
body: ${{ steps.changelog_reader.outputs.changes }}
draft: true
- name: Download linux-x86_64 artifact
uses: actions/download-artifact@v1
with:
name: mla-linux-x86_64
- name: Download windows-i686 artifact
uses: actions/download-artifact@v1
with:
name: mla-windows-i686
- name: Download windows-x86_64 artifact
uses: actions/download-artifact@v1
with:
name: mla-windows-x86_64
- name: Download windows-i686-debug artifact
uses: actions/download-artifact@v1
with:
name: mla-windows-i686-debug
- name: Download windows-x86_64-debug artifact
uses: actions/download-artifact@v1
with:
name: mla-windows-x86_64-debug
- name: Release Linux artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mla-linux-x86_64/libmla.a
asset_content_type: application/octet-stream
asset_name: libmla-x86_64-static-${{ steps.get_version.outputs.VERSION }}.a
- name: Zip Windows releases
run: |
zip --junk-paths windows-i686 mla-windows-i686/mla.dll mla-windows-i686/mla.lib mla-windows-i686/mla.dll.lib mla-windows-i686/mla.pdb
zip --junk-paths windows-x86_64 mla-windows-x86_64/mla.dll mla-windows-x86_64/mla.lib mla-windows-x86_64/mla.dll.lib mla-windows-x86_64/mla.pdb
zip --junk-paths windows-i686-debug mla-windows-i686-debug/mla.dll mla-windows-i686-debug/mla.lib mla-windows-i686-debug/mla.dll.lib mla-windows-i686-debug/mla.pdb
zip --junk-paths windows-x86_64-debug mla-windows-x86_64-debug/mla.dll mla-windows-x86_64-debug/mla.lib mla-windows-x86_64-debug/mla.dll.lib mla-windows-x86_64-debug/mla.pdb
- name: Release windows-i686
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows-i686.zip
asset_content_type: application/zip
asset_name: libmla-windows-i686-${{ steps.get_version.outputs.VERSION }}.zip
- name: Release windows-x86_64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows-x86_64.zip
asset_content_type: application/zip
asset_name: libmla-windows-x86_64-${{ steps.get_version.outputs.VERSION }}.zip
- name: Release windows-i686-debug
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows-i686-debug.zip
asset_content_type: application/zip
asset_name: libmla-windows-i686-debug-${{ steps.get_version.outputs.VERSION }}.zip
- name: Release windows-x86_64-debug
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./windows-x86_64-debug.zip
asset_content_type: application/zip
asset_name: libmla-windows-x86_64-debug-${{ steps.get_version.outputs.VERSION }}.zip
- uses: actions/checkout@v2
- name: Release C Header file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bindings/C/mla.h
asset_content_type: application/octet-stream
asset_name: mla.h
- name: Release CPP Header file
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./bindings/C/mla.hpp
asset_content_type: application/octet-stream
asset_name: mla.hpp