-
Notifications
You must be signed in to change notification settings - Fork 0
227 lines (222 loc) · 8.62 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
name: CI
on: [push, pull_request]
env:
VCPKG_COMMIT_HASH: 8eb57355a4ffb410a2e94c07b4dca2dffbee8e50
jobs:
createrelease:
name: createrelease
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo "version=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.version }}
release_name: Release v${{ env.version }}
prerelease: false
- name: Output Release URL File
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt
- name: Save Release URL File for publish
uses: actions/upload-artifact@v1
with:
name: release_url
path: release_url.txt
windows:
name: Windows
runs-on: windows-latest
needs: createrelease
if: always()
strategy:
fail-fast: false
matrix:
include:
- triplet: x86-windows-static
vcpkgPackages: 'curl[core,ssl] discord-rpc ijg-libjpeg sdl2'
- triplet: x64-windows-static
vcpkgPackages: 'curl[core,ssl] discord-rpc ijg-libjpeg sdl2'
- triplet: arm64-windows-static
vcpkgPackages: 'curl[core,ssl] discord-rpc ijg-libjpeg sdl2'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the version
if: startsWith(github.ref, 'refs/tags/v')
run: |
chcp 65001 #set code page to utf-8
echo ("version=" + $env:GITHUB_REF.replace('refs/tags/v', '')) >> $env:GITHUB_ENV
- name: Install vcpkg and packages
uses: lukka/run-vcpkg@v6
id: runvcpkg
with:
vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_HASH }}'
vcpkgTriplet: '${{ matrix.triplet }}'
vcpkgArguments: '${{ matrix.vcpkgPackages }}'
- name: Zip stuff
run: |
pushd ${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}\\installed\\${{ matrix.triplet }}
7z a -tzip -mx9 -mtc=off ..\ete-libs-v${{ env.version }}-${{ matrix.triplet }}.zip "*"
popd
- name: Upload zip as artifact
uses: actions/upload-artifact@v2
with:
name: ete-libs-v${{ env.version }}-${{ matrix.triplet }}.zip
path: ${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}\\installed\\ete-libs-v${{ env.version }}-${{ matrix.triplet }}.zip
- name: Load Release URL File from release job
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/download-artifact@v1
with:
name: release_url
- name: Get Release File Name & Upload URL
if: startsWith(github.ref, 'refs/tags/v')
id: get_release_info
shell: bash
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/v')
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}\\installed\\ete-libs-v${{ env.version }}-${{ matrix.triplet }}.zip
asset_name: ete-libs-v${{ env.version }}-${{ matrix.triplet }}.zip
asset_content_type: application/zip
linux:
name: Linux
runs-on: ubuntu-latest
needs: createrelease
if: always()
strategy:
fail-fast: false
matrix:
include:
- triplet: x86-linux
vcpkgPackages: 'curl[core,ssl] discord-rpc ijg-libjpeg sdl2'
- triplet: x64-linux
vcpkgPackages: 'curl[core,ssl] discord-rpc ijg-libjpeg sdl2'
#- triplet: arm64-linux
# vcpkgPackages: 'curl[core,ssl] discord-rpc ijg-libjpeg sdl2'
steps:
- name: Install tools (x86)
if: startsWith(matrix.triplet, 'x86')
run: |
sudo dpkg --add-architecture i386
sudo apt-get -qq update
sudo apt-get -y install gcc-multilib g++-multilib
- name: Checkout
uses: actions/checkout@v2
- name: Get the version
if: startsWith(github.ref, 'refs/tags/v')
run: |
chcp 65001 #set code page to utf-8
echo ("version=" + $env:GITHUB_REF.replace('refs/tags/v', '')) >> $env:GITHUB_ENV
# - name: Setup vcpkg (x86)
# if: startsWith(matrix.triplet, 'x86')
# uses: lukka/run-vcpkg@v6
# id: runvcpkg-x86
# with:
# vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_HASH }}'
# setupOnly: true
#- name: Install packages (x86)
# if: startsWith(matrix.triplet, 'x86')
# run: |
# export VCPKG_COMMIT_HASH='${{ env.VCPKG_COMMIT_HASH }}'
# ./linux_x86_build.sh
- name: Install vcpkg and packages
# if: ! startsWith(matrix.triplet, 'x86')
uses: lukka/run-vcpkg@v6
id: runvcpkg
with:
vcpkgGitCommitId: '${{ env.VCPKG_COMMIT_HASH }}'
vcpkgTriplet: '${{ matrix.triplet }}'
vcpkgArguments: '${{ matrix.vcpkgPackages }}'
- name: Zip stuff
run: |
pushd ${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}/installed/${{ matrix.triplet }}
7z a -tzip -mx9 -mtc=off ../ete-libs-v${{ env.version }}-${{ matrix.triplet }}.zip "*"
popd
- name: Upload zip as artifact
uses: actions/upload-artifact@v2
with:
name: ete-libs-v${{ env.version }}-${{ matrix.triplet }}.zip
path: ${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}/installed/ete-libs-v${{ env.version }}-${{ matrix.triplet }}.zip
- name: Load Release URL File from release job
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/download-artifact@v1
with:
name: release_url
- name: Get Release File Name & Upload URL
if: startsWith(github.ref, 'refs/tags/v')
id: get_release_info
shell: bash
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/v')
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}/installed/ete-libs-v${{ env.version }}-${{ matrix.triplet }}.zip
asset_name: ete-libs-v${{ env.version }}-${{ matrix.triplet }}.zip
asset_content_type: application/zip
macos:
name: macOS
runs-on: macos-latest
needs: createrelease
if: always()
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the version
if: startsWith(github.ref, 'refs/tags/v')
run: echo "version=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Install vcpkg and packages
id: macos_build
shell: bash
run: |
export VCPKG_COMMIT_HASH='${{ env.VCPKG_COMMIT_HASH }}'
brew install automake autoconf-archive pyyaml
./macos_build.sh
- name: Upload zip as artifact
uses: actions/upload-artifact@v2
with:
name: ete-libs-v${{ env.version }}-universal-macos-dylibs.zip
path: ete-libs-v${{ env.version }}-universal-macos-dylibs.zip
- name: Load Release URL File from release job
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/download-artifact@v1
with:
name: release_url
- name: Get Release File Name & Upload URL
if: startsWith(github.ref, 'refs/tags/v')
id: get_release_info
shell: bash
run: |
value=`cat release_url/release_url.txt`
echo ::set-output name=upload_url::$value
- name: Upload Release Asset
if: startsWith(github.ref, 'refs/tags/v')
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release_info.outputs.upload_url }}
asset_path: ete-libs-v${{ env.version }}-universal-macos-dylibs.zip
asset_name: ete-libs-v${{ env.version }}-universal-macos-dylibs.zip
asset_content_type: application/zip