forked from BambooTracker/BambooTracker
-
Notifications
You must be signed in to change notification settings - Fork 0
163 lines (143 loc) Β· 5.25 KB
/
windows-10-qt6.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
name: Windows 10 (64-bit, Qt6)
on:
push:
branches: master
tags: 'v*.*.*'
paths-ignore:
- '**.md'
- '**.txt'
- 'LICENSE'
- '.gitignore'
pull_request:
branches: master
paths-ignore:
- '**.md'
- '**.txt'
- 'LICENSE'
- '.gitignore'
defaults:
run:
shell: bash
env:
BUILD_TARGET: windows-10-64bit
MAKE: mingw32-make
BT_INSTALLBASE: ${{ github.workspace }}/target/
MINGW_VERSION: 8.1.0
MINGW_BITNESS: 64
MINGW_CHOCOBASE: /c/ProgramData/chocolatey/lib/mingw/tools/install/mingw64
MINGW_INSTALLBASE: ${{ github.workspace }}/mingw64/
QT_VERSION: 6.1.1
QT_TOOLCHAIN: win64_mingw81
QT_MODULES: qtbase qttools qttranslations qt5compat
QT_INSTALLBASE: ${{ github.workspace }}/Qt/
jobs:
build:
runs-on: windows-latest
steps:
- name: Identify build type.
id: identify-build
run: |
case ${GITHUB_REF} in
refs/tags/* )
TAG=${GITHUB_REF#refs/tags/}
echo "Release ${TAG}"
echo "::set-output name=build-tag::${TAG}"
echo "::set-output name=release::true"
;;
refs/pull/*)
PR=$(echo ${GITHUB_REF} | cut -d/ -f3)
echo "Test PR #${PR}"
echo "::set-output name=build-tag::pr-${PR}"
echo "::set-output name=release::false"
;;
refs/heads/* )
BRANCH=${GITHUB_REF#refs/heads/}
echo "Test ${BRANCH}"
echo "::set-output name=build-tag::${BRANCH}"
echo "::set-output name=release::false"
;;
* )
echo "Test (unknown)"
echo "::set-output name=build-tag::unknown"
echo "::set-output name=release::false"
;;
esac
- name: Checking out repository.
uses: actions/checkout@v2
with:
submodules: recursive
## Windows-specific steps
# Unable to cache system-installed MinGW. Uploaded cache is supposedly an empty tarball
# when trying to fetch it.
# > Received 30 of 30 (100.0%), 0.0 MBs/sec
# > Cache Size: ~0 MB (30 B)
# We instead copy & reown the MinGW installation to the GitHub workspace,
# ugly but it works. :/
- name: Fetching MinGW cache.
id: mingw-cache
uses: actions/cache@v2
with:
path: ${{ env.MINGW_INSTALLBASE }}
key: ${{ env.MINGW_VERSION }} ${{ env.MINGW_BITNESS }}
- name: Installing MinGW.
run: |
./scripts/fetch_mingw.sh ${MINGW_CHOCOBASE} ${MINGW_VERSION} ${MINGW_BITNESS} ${MINGW_INSTALLBASE}
# "Prepending to PATH" doesn't work properly and inserts the path *close*
# to the start of PATH, but *after* the system's MinGW path.
# Our MinGW PATH is not searched early enough to work for this build
# so we either manually reexport PATH for ever step or fiddle with the PATH even more. :/
# - name: Adding MinGW to PATH.
# run: |
# echo ${MINGW_CHOCOBASE}/bin >> ${GITHUB_PATH}
# Cache Qt installations, very costly & flakey to fetch
- name: Fetching Qt cache.
id: qt-cache
uses: actions/cache@v2
with:
path: ${{ env.QT_INSTALLBASE }}
key: ${{ runner.os }} Qt${{ env.QT_VERSION }} ${{ env.QT_TOOLCHAIN }} ${{ env.QT_MODULES }}
- name: Installing Qt.
run: |
./scripts/fetch_qt.sh ${QT_INSTALLBASE} ${QT_VERSION} ${QT_TOOLCHAIN} ${QT_MODULES}
- name: Adding Qt to PATH.
run: |
find ${QT_INSTALLBASE} -type d -name bin >> ${GITHUB_PATH}
## End Windows-specific steps
- name: Configuring.
run: |
export PATH="${MINGW_INSTALLBASE}/bin:${PATH}"
lupdate Project.pro
qmake Project.pro PREFIX=${BT_INSTALLBASE} \
CONFIG+=release CONFIG-=debug ${QMAKE_EXTRA_ARGUMENTS}
${MAKE} qmake_all
- name: Building.
run: |
export PATH="${MINGW_INSTALLBASE}/bin:${PATH}"
${MAKE} -j2
- name: Installing.
run: |
export PATH="${MINGW_INSTALLBASE}/bin:${PATH}"
${MAKE} -j2 install
- name: Test packaging.
if: env.DONT_PACKAGE != 'true'
run: |
export PATH="${MINGW_INSTALLBASE}/bin:${PATH}"
pushd ${BT_INSTALLBASE}
bash ${GITHUB_WORKSPACE}/scripts/package_${SCRIPT_NAME:-${BUILD_TARGET%%-*}}.sh
popd
- name: Finalize packaging.
id: packaging
if: steps.identify-build.outputs.release == 'true' && env.DONT_PACKAGE != 'true'
run: |
export package_name="BambooTracker-${{ steps.identify-build.outputs.build-tag }}-${BUILD_TARGET}"
echo "::set-output name=package-name::${package_name}"
mv -v ${BT_INSTALLBASE} ${package_name}
7z a -tzip ${package_name}{.zip,}
- name: Upload release package.
if: steps.identify-build.outputs.release == 'true' && env.DONT_PACKAGE != 'true'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ steps.packaging.outputs.package-name }}.zip
asset_name: ${{ steps.packaging.outputs.package-name }}.zip
tag: ${{ github.ref }}