generated from gdt050579/appcui-template
-
Notifications
You must be signed in to change notification settings - Fork 16
203 lines (166 loc) · 6.66 KB
/
deploy_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
name: "Deploy release"
on:
push:
branches:
- release
workflow_dispatch:
inputs:
isPreRelease:
description: 'Is the build pre release?'
required: true
default: true
type: boolean
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build-win:
runs-on: [windows-latest]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Add tag data to enviroment
run: |
$output=$(python .github/workflows/get_version.py GViewCore/include/GView.hpp)
echo "GVIEW_VERSION=$output" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Copy static libs from VCPKG
working-directory: "D:/a/GView/GView/bin/Release"
run: cp -R ../../build/vcpkg_installed/x64-windows/lib/*.lib .
- name: List bin artefacts
shell: cmd
run: dir /s "D:/a/GView/GView/bin"
- name: Create archive
run: |
$output=$(7z a "GView-${{ runner.os }}-${{runner.arch}}-${{ env.GVIEW_VERSION }}.zip" D:/a/GView/GView/bin/Release/*.lib)
echo "$output"
$output=$(7z a "GView-${{ runner.os }}-${{runner.arch}}-${{ env.GVIEW_VERSION }}.zip" D:/a/GView/GView/bin/Release/*.exe)
echo "$output"
$output=$(7z a "GView-${{ runner.os }}-${{runner.arch}}-${{ env.GVIEW_VERSION }}.zip" D:/a/GView/GView/bin/Release/*.dll)
echo "$output"
$output=$(7z a "GView-${{ runner.os }}-${{runner.arch}}-${{ env.GVIEW_VERSION }}.zip" D:/a/GView/GView/bin/Release/*/*.tpl)
echo "$output"
$output=$(7z a "GView-${{ runner.os }}-${{runner.arch}}-${{ env.GVIEW_VERSION }}.zip" D:/a/GView/GView/bin/Release/*/*.gpl)
echo "$output"
- name: Store Artifacts
uses: actions/upload-artifact@v3
with:
name: windows_artifacts
path: "GView-${{ runner.os }}-${{runner.arch}}-${{ env.GVIEW_VERSION }}.zip"
retention-days: 1
build-macos:
runs-on: [macos-latest]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
# https://github.com/dotnet/runtime/issues/82240
# temporarily install pkg-config via brew
# - name: Install pkg-config
# run: |
# brew update
# brew install pkg-config
# brew upgrade
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Add tag data to enviroment
run: |
output=$(python .github/workflows/get_version.py GViewCore/include/GView.hpp)
echo "GVIEW_VERSION=$output" >> $GITHUB_ENV
- name: Copy static libs from VCPKG
working-directory: /Users/runner/work/GView/GView/bin/Release
run: cp -R ../../build/vcpkg_installed/x64-osx/lib/*.a .
- name: Copy terminfo from VCPKG
working-directory: /Users/runner/work/GView/GView/bin/Release
run: cp -R ../../build/vcpkg_installed/x64-osx/share/terminfo .
- name: List bin artefacts
run: ls -R /Users/runner/work/GView/GView/bin
- name: Create archive
working-directory: /Users/runner/work/GView/GView/bin/Release
run: |
output=$(zip -9 -r "GView-${{ runner.os }}-${{runner.arch}}-${{ env.GVIEW_VERSION }}.zip" .)
echo "$output"
- name: Store Artifacts
uses: actions/upload-artifact@v3
with:
name: apple_artifacts
path: "/Users/runner/work/GView/GView/bin/Release/GView-${{ runner.os }}-${{runner.arch}}-${{ env.GVIEW_VERSION }}.zip"
retention-days: 1
build-ubuntu:
runs-on: [ubuntu-latest]
env:
CC: gcc-10
CXX: g++-10
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Update
run: sudo apt-get update
- name: Install libx11-dev
run: sudo apt-get install libx11-dev
- name: GCC & G++ multilib
run: sudo apt-get install g++-multilib gcc-multilib -y
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Add tag data to enviroment
run: |
output=$(python .github/workflows/get_version.py GViewCore/include/GView.hpp)
echo "GVIEW_VERSION=$output" >> $GITHUB_ENV
- name: Copy static libs from VCPKG
working-directory: /home/runner/work/GView/GView/bin/Release
run: cp -R ../../build/vcpkg_installed/x64-linux/lib/*.a .
- name: Copy terminfo from VCPKG
working-directory: /home/runner/work/GView/GView/bin/Release
run: cp -R ../../build/vcpkg_installed/x64-linux/share/terminfo .
- name: List bin artefacts
run: ls -R /home/runner/work/GView/GView/bin
- name: Create archive
working-directory: /home/runner/work/GView/GView/bin/Release
run: |
output=$(zip -9 -r "GView-${{ runner.os }}-${{runner.arch}}-${{ env.GVIEW_VERSION }}.zip" .)
echo "$output"
- name: Store Artifacts
uses: actions/upload-artifact@v3
with:
name: linux_artifacts
path: "/home/runner/work/GView/GView/bin/Release/GView-${{ runner.os }}-${{runner.arch}}-${{ env.GVIEW_VERSION }}.zip"
retention-days: 1
publish_job:
name: "Publish to release"
runs-on: [ubuntu-latest]
needs: [build-win, build-ubuntu, build-macos]
steps:
- uses: actions/checkout@v2
- name: Add tag data to enviroment
run: |
output=$(python .github/workflows/get_version.py GViewCore/include/GView.hpp)
echo "GVIEW_VERSION=$output" >> $GITHUB_ENV
- uses: actions/download-artifact@v2
with:
name: windows_artifacts
path: artifacts
- uses: actions/download-artifact@v2
with:
name: linux_artifacts
path: artifacts
- uses: actions/download-artifact@v2
with:
name: apple_artifacts
path: artifacts
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{env.GVIEW_VERSION}}"
prerelease: true # ${{ github.event.inputs.isPreRelease }}
title: Build ${{env.GVIEW_VERSION}}
files: |
artifacts/*.zip