forked from XboxDev/extract-xiso
-
Notifications
You must be signed in to change notification settings - Fork 0
201 lines (195 loc) · 6.07 KB
/
CI.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
name: CI
on:
push:
paths-ignore:
- '*.md'
- '*.yml'
pull_request:
paths-ignore:
- '*.md'
- '*.yml'
jobs:
Init:
runs-on: ubuntu-latest
steps:
- name: Create build tag
run: |
export BUILD_TAG=build-$(date -u +'%Y%m%d%H%M')
echo "BUILD_TAG=$BUILD_TAG" >> $GITHUB_ENV
echo -n $BUILD_TAG > tag
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: tag
path: tag
build-windows:
runs-on: windows-latest
needs: Init
env:
POWERSHELL_TELEMETRY_OPTOUT: 1
strategy:
fail-fast: false
matrix:
configuration: [Release, Debug]
arch: [x86, x64]
include:
- arch: x86
platform: Win32
artifact_os: Win32
- arch: x64
platform: x64
artifact_os: Win64
steps:
- uses: actions/checkout@v2
- name: CMake generate
run: |
mkdir build && cd build
cmake .. -A ${{ matrix.platform }}
- name: Build
working-directory: build
run: cmake --build . --config ${{ matrix.configuration }} -j $env:NUMBER_OF_PROCESSORS
- name: Prepare artifacts
run: |
mkdir artifacts
mv -vb build\${{ matrix.configuration }}\extract-xiso.exe, LICENSE.TXT artifacts
- uses: actions/upload-artifact@v2
with:
name: extract-xiso_${{ matrix.artifact_os }}_${{ matrix.configuration }}
path: artifacts
build-linux:
runs-on: ubuntu-latest
needs: Init
steps:
- uses: actions/checkout@v2
- name: CMake generate
run: |
mkdir build && cd build
cmake ..
- name: Build
working-directory: build
run: cmake --build . -j $(nproc --all)
- name: Prepare artifacts
run: |
mkdir artifacts
mv -v build/extract-xiso LICENSE.TXT artifacts
- uses: actions/upload-artifact@v2
with:
name: extract-xiso_${{ runner.os }}
path: artifacts
build-macos:
runs-on: macos-latest
needs: Init
steps:
- uses: actions/checkout@v2
- name: CMake generate
run: |
mkdir build && cd build
cmake ..
- name: Build
working-directory: build
run: cmake --build . -j $(sysctl -n hw.ncpu)
- name: Prepare artifacts
run: |
mkdir artifacts
mv -v build/extract-xiso LICENSE.TXT artifacts
- uses: actions/upload-artifact@v2
with:
name: extract-xiso_${{ runner.os }}
path: artifacts
Release:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: [build-windows, build-linux, build-macos]
env:
BUILD_TAG:
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
with:
path: dist
- name: Create archives
run: |
pushd dist/extract-xiso_Win32_Release
zip -r ../extract-xiso-win32-release.zip *
popd
pushd dist/extract-xiso_Win32_Debug
zip -r ../extract-xiso-win32-debug.zip *
popd
###
# Comment out 64 bit builds as they are currently broken
###
# pushd dist/extract-xiso_Win64_Release
# zip -r ../extract-xiso-win64-release.zip *
# popd
# pushd dist/extract-xiso_Win64_Debug
# zip -r ../extract-xiso-win64-debug.zip *
# popd
# pushd dist/extract-xiso_macOS
# zip -r ../extract-xiso-macos.zip *
# popd
- name: Get package info
run: |
echo "BUILD_TAG=$(cat dist/tag/tag)" >> $GITHUB_ENV
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.BUILD_TAG }}
release_name: ${{ env.BUILD_TAG }}
draft: false
prerelease: false
- name: Upload release assets (Win32 build)
id: upload-release-assets-win32-release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: extract-xiso-win32-release.zip
asset_path: dist/extract-xiso-win32-release.zip
asset_content_type: application/zip
- name: Upload release assets (Win32 debug build)
id: upload-release-assets-win32-debug
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_name: extract-xiso-win32-debug.zip
asset_path: dist/extract-xiso-win32-debug.zip
asset_content_type: application/zip
###
# Comment out 64 bit builds as they are currently broken
###
# - name: Upload release assets (Win64 build)
# id: upload-release-assets-win64-release
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_name: extract-xiso-win64-release.zip
# asset_path: dist/extract-xiso-win64-release.zip
# asset_content_type: application/zip
# - name: Upload release assets (Win64 debug build)
# id: upload-release-assets-win64-debug
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_name: extract-xiso-win64-debug.zip
# asset_path: dist/extract-xiso-win64-debug.zip
# asset_content_type: application/zip
# - name: Upload release assets (macOS build)
# id: upload-release-assets-macos-release
# uses: actions/[email protected]
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_name: extract-xiso-macos.zip
# asset_path: dist/extract-xiso-macos.zip
# asset_content_type: application/zip