@@ -22,23 +22,20 @@ jobs:
22
22
- name : ' Check out code (Common)'
23
23
uses : actions/checkout@v4
24
24
25
- - name : ' Set reusable strings (Ubuntu)'
26
- id : strings-linux
27
- if : runner.os == 'Linux'
25
+ - name : ' Set reusable strings (Common)'
26
+ id : strings-common
28
27
shell : bash
29
28
run : |
30
29
echo "build-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
31
30
echo "build-version=${{ (github.ref_name == 'master' || github.ref_name == 'develop') && '0.0.0' || github.ref_name }}" >> "$GITHUB_OUTPUT"
32
- echo "cpu-count=$(nproc)" >> "$GITHUB_OUTPUT"
31
+ echo "build-name=${{ (github.ref_name == 'master' || github.ref_name == 'develop') && 'latest' || github.ref_name }}" >> "$GITHUB_OUTPUT"
32
+ echo "cpu-count=4" >> "$GITHUB_OUTPUT"
33
33
34
34
- name : ' Set reusable strings (Windows)'
35
35
if : runner.os == 'Windows'
36
36
id : strings-windows
37
37
shell : bash
38
38
run : |
39
- echo "build-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
40
- echo "build-version=${{ github.ref_name == 'master' && '0.0.0' || github.ref_name }}" >> "$GITHUB_OUTPUT"
41
- echo "build-name=${{ github.ref_name == 'master' && 'latest' || github.ref_name }}" >> "$GITHUB_OUTPUT"
42
39
echo "qt-dir=${{ github.workspace }}/qt/6.7.2/mingw_64" >> "$GITHUB_OUTPUT"
43
40
echo "ninja-dir=${{ github.workspace }}/tools/ninja" >> "$GITHUB_OUTPUT"
44
41
echo "cmake-dir=${{ github.workspace }}/tools/cmake_64" >> "$GITHUB_OUTPUT"
47
44
echo "package-dir=${{ github.workspace }}/build/installer/package" >> "$GITHUB_OUTPUT"
48
45
echo "package-data-dir=${{ github.workspace }}/build/installer/package/org.josevcm.nfc-lab/data" >> "$GITHUB_OUTPUT"
49
46
echo "package-meta-dir=${{ github.workspace }}/build/installer/package/org.josevcm.nfc-lab/meta" >> "$GITHUB_OUTPUT"
50
- echo "cpu-count=4" >> "$GITHUB_OUTPUT"
51
47
52
48
- name : ' Cache dependencies (Windows)'
53
49
id : cache-dependencies
@@ -78,24 +74,24 @@ jobs:
78
74
- name : ' Build project (Ubuntu)'
79
75
if : runner.os == 'Linux'
80
76
run : |
81
- dpkg-buildpackage -us -uc -j${{ steps.strings-linux .outputs.cpu-count }}
77
+ dpkg-buildpackage -us -uc -j${{ steps.strings-common .outputs.cpu-count }}
82
78
83
79
- name : ' Build project (Windows)'
84
80
if : runner.os == 'Windows'
85
81
run : |
86
82
${{ steps.strings-windows.outputs.cmake-dir }}/bin/cmake `
87
83
-S ${{ github.workspace }} `
88
- -B ${{ steps.strings-windows .outputs.build-dir }} `
84
+ -B ${{ steps.strings-common .outputs.build-dir }} `
89
85
-G Ninja `
90
86
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
91
87
-DCMAKE_PREFIX_PATH=${{ steps.strings-windows.outputs.qt-dir }} `
92
88
-DCMAKE_C_COMPILER=${{ steps.strings-windows.outputs.mingw-dir }}/bin/gcc.exe `
93
89
-DCMAKE_CXX_COMPILER=${{ steps.strings-windows.outputs.mingw-dir }}/bin/g++.exe `
94
90
-DCMAKE_MAKE_PROGRAM=${{ steps.strings-windows.outputs.ninja-dir }}/ninja.exe `
95
- -DBUILD_PROJECT_VERSION="${{ steps.strings-windows .outputs.build-version }}"
91
+ -DBUILD_PROJECT_VERSION="${{ steps.strings-common .outputs.build-version }}"
96
92
${{ steps.strings-windows.outputs.cmake-dir }}/bin/cmake `
97
- --build ${{ steps.strings-windows .outputs.build-dir }} `
98
- --target nfc-lab --parallel ${{ steps.strings-windows .outputs.cpu-count }}
93
+ --build ${{ steps.strings-common .outputs.build-dir }} `
94
+ --target nfc-lab --parallel ${{ steps.strings-common .outputs.cpu-count }}
99
95
100
96
- name : ' Create installer (Windows)'
101
97
if : runner.os == 'Windows'
@@ -105,7 +101,7 @@ jobs:
105
101
New-Item -Force -ItemType "directory" -Path ${{ steps.strings-windows.outputs.package-meta-dir }}
106
102
107
103
# copy executable and libraries
108
- Copy-Item -Force ${{ steps.strings-windows .outputs.build-dir }}/src/nfc-app/app-qt/nfc-lab.exe ${{ steps.strings-windows.outputs.package-data-dir }}
104
+ Copy-Item -Force ${{ steps.strings-common .outputs.build-dir }}/src/nfc-app/app-qt/nfc-lab.exe ${{ steps.strings-windows.outputs.package-data-dir }}
109
105
Copy-Item -Force ${{ steps.strings-windows.outputs.mingw-dir }}/bin/*.dll ${{ steps.strings-windows.outputs.package-data-dir }}
110
106
Copy-Item -Force ${{ github.workspace }}/dll/airspy/x86_64/bin/*.dll ${{ steps.strings-windows.outputs.package-data-dir }}
111
107
Copy-Item -Force ${{ github.workspace }}/dll/openssl/x86_64/bin/*.dll ${{ steps.strings-windows.outputs.package-data-dir }}
@@ -118,7 +114,7 @@ jobs:
118
114
Copy-Item -Force -Recurse ${{ github.workspace }}/dat/firmware ${{ steps.strings-windows.outputs.package-data-dir }}
119
115
120
116
# copy installer resources
121
- Copy-Item -Force ${{ steps.strings-windows .outputs.build-dir }}/installer/config/*.* ${{ steps.strings-windows.outputs.package-meta-dir }}
117
+ Copy-Item -Force ${{ steps.strings-common .outputs.build-dir }}/installer/config/*.* ${{ steps.strings-windows.outputs.package-meta-dir }}
122
118
123
119
# create deployment
124
120
${{ steps.strings-windows.outputs.qt-dir }}/bin/windeployqt `
@@ -132,16 +128,16 @@ jobs:
132
128
# create installer
133
129
${{ steps.strings-windows.outputs.installer-dir }}/bin/binarycreator `
134
130
--verbose `
135
- -c ${{ steps.strings-windows .outputs.build-dir }}/installer/config/config.xml `
131
+ -c ${{ steps.strings-common .outputs.build-dir }}/installer/config/config.xml `
136
132
-p ${{ steps.strings-windows.outputs.package-dir }} `
137
- ${{ steps.strings-windows .outputs.build-dir }}/nfc-lab-${{ steps.strings-windows .outputs.build-name }}-installer-x86_64.exe
133
+ ${{ steps.strings-common .outputs.build-dir }}/nfc-lab-${{ steps.strings-common .outputs.build-name }}-installer-x86_64.exe
138
134
139
135
- name : ' Upload artifact (Windows)'
140
136
if : runner.os == 'Windows'
141
137
uses : actions/upload-artifact@v4
142
138
with :
143
- name : nfc-lab-${{ steps.strings-windows .outputs.build-name }}-installer-x86_64.exe
144
- path : ${{ steps.strings-windows .outputs.build-dir }}/nfc-lab-${{ steps.strings-windows .outputs.build-name }}-installer-x86_64.exe
139
+ name : nfc-lab-${{ steps.strings-common .outputs.build-name }}-installer-x86_64.exe
140
+ path : ${{ steps.strings-common .outputs.build-dir }}/nfc-lab-${{ steps.strings-common .outputs.build-name }}-installer-x86_64.exe
145
141
146
142
- name : ' Create release (Common)'
147
143
if : startsWith(github.ref, 'refs/tags/')
@@ -162,8 +158,8 @@ jobs:
162
158
uses : actions/upload-release-asset@v1
163
159
with :
164
160
upload_url : ${{ steps.create-release.outputs.upload_url }}
165
- asset_name : nfc-lab-${{ steps.strings-windows .outputs.build-name }}-installer-x86_64.exe
166
- asset_path : ${{ steps.strings-windows .outputs.build-dir }}/nfc-lab-${{ steps.strings-windows .outputs.build-name }}-installer-x86_64.exe
161
+ asset_name : nfc-lab-${{ steps.strings-common .outputs.build-name }}-installer-x86_64.exe
162
+ asset_path : ${{ steps.strings-common .outputs.build-dir }}/nfc-lab-${{ steps.strings-common .outputs.build-name }}-installer-x86_64.exe
167
163
asset_content_type : application/octet-stream
168
164
env :
169
165
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments