-
Notifications
You must be signed in to change notification settings - Fork 10
215 lines (208 loc) · 6.78 KB
/
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
name: Release
on:
workflow_dispatch:
inputs:
level:
type: choice
description: Release type
options:
- patch
- minor
- major
jobs:
versioning:
runs-on: ubuntu-20.04
steps:
# Get latest released version
- uses: oprypin/find-latest-tag@v1
with:
repository: i3drobotics/stereo-vision-toolkit # The repository to scan.
releases-only: true # All relevant tags have a GitHub release for them.
id: latest-tag # The step ID to refer to later.
# Generate new release version
- name: Generate new version
uses: actions-ecosystem/action-bump-semver@v1
id: bump-version
with:
current_version: ${{ steps.latest-tag.outputs.tag }}
level: ${{ github.event.inputs.level }}
# Add generated version to VERSION file
# remove 'v' character from version string
- name: Add to Version file
shell: bash
run: |
PROJ_VERSION=${{ steps.bump-version.outputs.new_version }}
PROJ_VERSION=${PROJ_VERSION:1}
echo "$PROJ_VERSION" > version.txt
# Upload version file for use in other jobs
- name: Archive version file
uses: actions/upload-artifact@v2
with:
name: version-file-${{ github.sha }}
path: version.txt
build:
needs: [versioning]
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
# Checkout submodules (required for fever module used in app update system)
- name: Checkout submodules
run: git submodule update --init --recursive
# Get project version
- name: Download version file artifact
uses: actions/download-artifact@v2
with:
name: version-file-${{ github.sha }}
path: versioning
- name: Get project version
shell: bash
run: |
PROJ_VER=$(cat versioning/version.txt)
echo "$PROJ_VER" > version.txt
echo "PROJ_VER=$PROJ_VER" >> $GITHUB_ENV
# Setup build environment
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.14.2'
host: 'windows'
target: 'desktop'
arch: 'win64_msvc2017_64'
dir: '${{ github.workspace }}/qt-install/'
install-deps: 'true'
modules: 'qtwebengine'
tools-only: 'false'
- name: Install jom, inno setup, doxygen
shell: powershell
run: |
choco install jom
choco install innosetup
choco install doxygen.install
# Install 3rd party dependencies
- name: Install 3rdparty
shell: cmd
run: |
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
.\scripts\3rdparty.bat
# Build application
- name: Build
shell: cmd
run: |
call "%programfiles(x86)%\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
mkdir build
cd build
qmake.exe "CONFIG+=qtquickcompiler WITH_I3DRSGM SHOW_CONSOLE" ../stereo_vision_toolkit.pro -spec win32-msvc
jom.exe
# Update version in files
- name: Update version
shell: cmd
run: |
scripts\update_version.bat
# Create installer
- name: Create installer
shell: cmd
run: |
iscc installer\installer.iss
# Update documentation
- name: Update docs
shell: bash
run: |
./scripts/docs.sh
# Upload docs to artifact for use in release
- name: Upload docs
uses: actions/upload-artifact@v2
with:
path: docs
name: docs-${{ github.sha }}
# Upload release data to artifact for use in release
- name: Upload release data
uses: actions/upload-artifact@v2
with:
path: |
release.md
Appcast.xml
installer/Output/*.exe
name: release-${{ github.sha }}
deploy:
needs: [build]
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
# Get project version
- name: Download version file artifact
uses: actions/download-artifact@v2
with:
name: version-file-${{ github.sha }}
path: versioning
- name: Get project version
shell: bash
run: |
PROJ_VER=$(cat versioning/version.txt)
echo "$PROJ_VER" > version.txt
echo "PROJ_VER=$PROJ_VER" >> $GITHUB_ENV
# Download installer from build artifacts
- name: Download installer artifact
uses: actions/download-artifact@v2
with:
name: release-${{ github.sha }}
path: release
# Download docs from build artifacts
- name: Download docs artifact
uses: actions/download-artifact@v2
with:
name: docs-${{ github.sha }}
path: docs_new
# Create GitHub release
- name: Release
uses: softprops/action-gh-release@v1
with:
draft: false
body_path: release/release.md
tag_name: v${{ env.PROJ_VER }}
files: |
release/*
release/installer/Output/*
# Deploy documentation
- name: Deploy docs
uses: JamesIves/github-pages-deploy-action@v4.2.3
with:
branch: docs # The branch the action should deploy to.
folder: docs_new # The folder the action should deploy.
# Get git variables
- name: Get commit variables
id: commit-vars
shell: bash
run: |
echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
# Merge branch into production
- name: Merge main -> prod
uses: devmasx/merge-branch@master
with:
type: now
target_branch: prod
github_token: ${{ github.token }}
message: Release v${{ env.PROJ_VER }} ${{ steps.commit-vars.outputs.sha_short }}
# Merge main back to production
- name: Merge prod -> main
uses: devmasx/merge-branch@master
with:
type: now
from_branch: prod
target_branch: main
github_token: ${{ github.token }}
message: Release v${{ env.PROJ_VER }} ${{ steps.commit-vars.outputs.sha_short }}
cleanup:
needs: [deploy]
runs-on: ubuntu-20.04
steps:
# Cleanup artifacts used for job sharing
- uses: geekyeggo/delete-artifact@v1
with:
name: version-file-${{ github.sha }}
- uses: geekyeggo/delete-artifact@v1
with:
name: docs-${{ github.sha }}
- uses: geekyeggo/delete-artifact@v1
with:
name: release-${{ github.sha }}