Skip to content

Commit 7c737c2

Browse files
committed
unique naming structure for lin/mac/win artifacts/assets
Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>
1 parent 6a44d57 commit 7c737c2

File tree

4 files changed

+40
-28
lines changed

4 files changed

+40
-28
lines changed

.github/workflows/build_check.yml

+32-16
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,30 @@ env:
88
# CMake build type (Release, Debug, RelWithDebInfo, etc.)
99
BUILD_TYPE: Release
1010

11+
1112
jobs:
1213
build_check:
1314
strategy:
1415
# do not stop on 1st fail
1516
fail-fast: false
1617
matrix:
17-
# GitHub hosted runners do not support Qt on Windows
1818
# use Ubuntu1804 until Debian "bullseye" becomes "stable"
1919
os: [ubuntu-18.04, macos-10.15, windows-2019]
2020

2121
runs-on: ${{ matrix.os }}
2222

23+
2324
steps:
2425

26+
27+
# --- Clone the latest commit ---
28+
2529
- name: Checkout
2630
uses: actions/checkout@v2
2731

2832

33+
# --- Linux (Ubuntu) steps ---
34+
2935
- name: Install Ubuntu Build Requirements
3036
if: startsWith(matrix.os, 'ubuntu')
3137
run:
@@ -36,23 +42,28 @@ jobs:
3642
cp ../CHANGELOG changelog;
3743
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE
3844

45+
3946
- name: Ubuntu Build
4047
# GitHub hosts Linux runners on Standard_DS2_v2 virtual machines in Microsoft Azure:
4148
# 2-core CPU, 7 GB of RAM memory, 14 GB of SSD disk space
4249
working-directory: ${{github.workspace}}/build
4350
if: startsWith(matrix.os, 'ubuntu')
4451
run:
4552
make -j8;
46-
fakeroot make -j8 package
53+
fakeroot make -j8 package;
54+
ls -l packages
55+
4756

4857
- name: Upload Ubuntu Artifacts
58+
# *.deb *.rpm *.tgz
4959
if: startsWith(matrix.os, 'ubuntu')
5060
uses: actions/upload-artifact@v2
5161
with:
5262
name: openhantek_linux_amd64_${{github.run_number}}
5363
path: ${{github.workspace}}/build/packages/
5464

5565

66+
# --- macOS steps ---
5667

5768
- name: Install macOS Build Requirements
5869
if: startsWith(matrix.os, 'macos')
@@ -65,6 +76,7 @@ jobs:
6576
cp ../CHANGELOG changelog;
6677
cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_PREFIX_PATH=${Qt5_DIR}
6778

79+
6880
- name: macOS Build
6981
# GitHub hosts macOS runners in GitHub's own macOS Cloud:
7082
# 3-core CPU, 14 GB of RAM memory, 14 GB of SSD disk space
@@ -91,7 +103,8 @@ jobs:
91103
if test -f OpenHantek.dmg; then
92104
sudo mv OpenHantek.dmg ../packages/$(basename ../packages/openhantek_*_osx_*.tar.gz .tar.gz).dmg;
93105
fi;
94-
cd ..;
106+
cd ..;
107+
ls -l packages;
95108
else true;
96109
fi
97110

@@ -104,49 +117,52 @@ jobs:
104117
path: ${{github.workspace}}/build/packages/*.dmg
105118

106119

120+
# --- Windows steps ---
107121

108122
- name: Install Qt for Windows
109123
if: startsWith(matrix.os, 'windows')
110124
uses: jurplel/install-qt-action@v2
111125

126+
112127
- name: Install Windows Build Requirements
113128
if: startsWith(matrix.os, 'windows')
114129
run:
115130
md build &
116131
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" &
117132
cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH=%Qt5_DIR% -DCMAKE_BUILD_TYPE=Release -Bbuild
118133

134+
119135
- name: Windows Build
120136
# GitHub hosts Windows runners on Standard_DS2_v2 virtual machines in Microsoft Azure:
121137
# 2-core CPU, 7 GB of RAM memory, 14 GB of SSD disk space
122138
working-directory: ${{github.workspace}}/build
123139
if: startsWith(matrix.os, 'windows')
140+
shell: bash
124141
run:
125-
cmake --build . --config Release --target package
142+
cmake --build . --parallel 8 --config Release --target package;
143+
ZIP=$(basename packages/openhantek_*_win_x64.zip);
144+
rm -f packages/openhantek_*_win_x64.*;
145+
cd openhantek/Release;
146+
7z a ../../packages/$ZIP *;
147+
cd ../..;
148+
ls -l packages;
126149

127150

128151
- name: Upload Windows Artifacts
129152
if: startsWith(matrix.os, 'windows')
130153
uses: actions/upload-artifact@v2
131154
with:
132-
name: OpenHantek_Win_x64_${{github.run_number}}
133-
path: ${{github.workspace}}/build/openhantek/Release
155+
name: openhantek_win_x64_${{github.run_number}}
156+
path: ${{github.workspace}}/build/packages/*.zip
134157

135158

159+
# --- Tagged Commit -> Upload Release ---
136160

137-
- name: Upload Linux / macOS Release Assets
161+
- name: Upload Linux / macOS / Windows Release Assets
162+
if: startsWith(github.ref, 'refs/tags/')
138163
uses: softprops/action-gh-release@v1
139-
if: ${{ startsWith(github.ref, 'refs/tags/') && ( startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'ubuntu') ) }}
140164
with:
141165
files: ${{github.workspace}}/build/packages/*
142166
env:
143167
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144168

145-
146-
- name: Upload Windows Release Assets
147-
uses: softprops/action-gh-release@v1
148-
if: ${{ startsWith(github.ref, 'refs/tags/') && startsWith(matrix.os, 'windows') }}
149-
with:
150-
files: ${{github.workspace}}/build/openhantek/Release/*
151-
env:
152-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

cmake/CPackInfos.cmake

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ if (UNIX)
122122

123123
elseif(WIN32)
124124
set(CPACK_TARGET "win_")
125-
set(CPACK_GENERATOR ${CPACK_GENERATOR} ZIP NSIS)
125+
set(CPACK_GENERATOR ${CPACK_GENERATOR} ZIP)
126126
if ((MSVC AND CMAKE_GENERATOR MATCHES "Win64+") OR (CMAKE_SIZEOF_VOID_P EQUAL 8))
127-
set(CPACK_ARCH "amd64")
127+
set(CPACK_ARCH "x64")
128128
else()
129-
set(CPACK_ARCH "x86")
129+
set(CPACK_ARCH "x32")
130130
endif()
131131
endif()
132132

cmake/copy_qt5_dlls_to_bin_dir.cmake

+4-8
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,8 @@ endif()
88
if (MSVC)
99
add_custom_command(TARGET ${PROJECT_NAME}
1010
POST_BUILD
11-
#if (EXISTS "${QT5_BIN_DIR}/qtenv2.bat")
12-
# COMMAND "${QT5_BIN_DIR}/qtenv2.bat"
13-
#endif()
14-
COMMAND "${QT5_BIN_DIR}/windeployqt" --no-translations "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/${PROJECT_NAME}.exe"
11+
# COMMAND "${QT5_BIN_DIR}/qtenv2.bat"
12+
COMMAND "${QT5_BIN_DIR}/windeployqt" --no-translations --compiler-runtime "${CMAKE_CURRENT_BINARY_DIR}/$<CONFIGURATION>/${PROJECT_NAME}.exe"
1513
WORKING_DIRECTORY "${QT5_BIN_DIR}"
1614
COMMENT "Copy Qt5 dlls for ${PROJECT_NAME}"
1715
)
@@ -21,10 +19,8 @@ else()
2119
endif()
2220
add_custom_command(TARGET ${PROJECT_NAME}
2321
POST_BUILD
24-
#if (EXISTS "${QT5_BIN_DIR}/qtenv2.bat")
25-
# COMMAND "${QT5_BIN_DIR}/qtenv2.bat"
26-
#endif()
27-
COMMAND "${QT5_BIN_DIR}/windeployqt" --no-translations ${ADD_OPT} "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.exe"
22+
# COMMAND "${QT5_BIN_DIR}/qtenv2.bat"
23+
COMMAND "${QT5_BIN_DIR}/windeployqt" --no-translations --compiler-runtime ${ADD_OPT} "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.exe"
2824
WORKING_DIRECTORY "${QT5_BIN_DIR}"
2925
COMMENT "Copy Qt5 dlls for ${PROJECT_NAME}"
3026
)

openhantek/src/OH_BUILD.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Do not edit, will be re-created at each commit!
2-
#define OH_BUILD "20210409 build 0"
2+
#define OH_BUILD "20210411 build 0"

0 commit comments

Comments
 (0)