-
Notifications
You must be signed in to change notification settings - Fork 9
148 lines (119 loc) · 3.88 KB
/
build.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
name: Build
on:
push:
env:
QT_VERSION: '6.4.1'
jobs:
build-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: submodules-init
uses: snickerbockers/submodules-init@v4
- name: Install Qt6
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
archives: 'qtbase qtsvg'
- name: Hack together libicu
run: |
wget https://github.com/unicode-org/icu/releases/download/release-56-1/icu4c-56_1-RHEL6-x64.tgz
tar -xvf icu4c-56_1-RHEL6-x64.tgz
- name: Generate
working-directory: ${{github.workspace}}
run: cmake . -DCMAKE_BUILD_TYPE=Release -DQT_BASEDIR=$Qt6_DIR -B ./build
- name: Build
working-directory: ${{github.workspace}}
run: |
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD/usr/local/lib"
echo $LD_LIBRARY_PATH
cmake --build ./build
- name: Package Artifacts
run: |
cd build
zip ../vtex2.linux-amd64.zip vtex2 vtfview
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: vtex2.linux-amd64
path: vtex2.linux-amd64.zip
if-no-files-found: warn
# Windows build + artifact upload
build-windows:
runs-on: windows-latest
strategy:
matrix:
build_config: ["Release"]
steps:
- uses: actions/checkout@v3
- name: submodules-init
uses: snickerbockers/submodules-init@v4
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Install Qt6
uses: jurplel/install-qt-action@v3
with:
version: ${{env.QT_VERSION}}
archives: 'qtbase qtsvg'
- name: Generate Solution
working-directory: ${{github.workspace}}
run: cmake . -G "Visual Studio 17 2022" -DQT_BASEDIR=$Qt6_DIR -B build
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{matrix.build_config}} build\vtex2.sln
- name: Package Artifacts
run: |
Get-ChildItem -Path build\Release\vtex2.exe, build\Release\vtfview.exe | Compress-Archive -DestinationPath vtex2.windows-amd64.zip
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: vtex2.windows-amd64
path: vtex2.windows-amd64.zip
if-no-files-found: warn
# Release draft + artifact upload
draft-release:
needs: [build-windows, build-linux]
runs-on: ubuntu-latest
if: github.ref_name == 'main'
steps:
# Get the artifacts from previous stages
- uses: actions/download-artifact@master
with:
name: vtex2.windows-amd64
- uses: actions/download-artifact@master
with:
name: vtex2.linux-amd64
- run: ls -R
- name: Store SHA
run: echo "GH_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# Draft a release
- name: Draft Release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: true
release_name: vtex2 - ${{github.sha}}
tag_name: ${{github.ref}}
env:
GITHUB_TOKEN: ${{github.token}}
# Upload the linux artifacts
- name: Upload Linux Artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{github.token}}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: ./vtex2.linux-amd64.zip
asset_name: vtex2.linux-amd64.zip
asset_content_type: application/zip
# Upload the windows artifacts
- name: Upload Windows Artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{github.token}}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: ./vtex2.windows-amd64.zip
asset_name: vtex2.windows-amd64.zip
asset_content_type: application/zip