Skip to content

Commit e1432bc

Browse files
build: always use wireshark patch version 0 (#48)
* build: always use wireshark patch version 0 * use fromJSON to work around reused workflow issue
1 parent b7a54b6 commit e1432bc

File tree

3 files changed

+37
-52
lines changed

3 files changed

+37
-52
lines changed

.github/workflows/build_plugin.yml

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,18 @@ on:
1010
inputs:
1111
version_major:
1212
description: "Major version of the wireshark tag to use when building the plugin"
13-
type: string
13+
type: number
1414
required: true
15-
default: '4'
15+
default: 4
1616
version_minor:
1717
description: "Minor version of the wireshark tag to use when building the plugin"
18-
type: string
18+
type: number
1919
required: true
20-
default: '6'
20+
default: 6
2121
version_patch:
22-
description: "Patch version of the wireshark tag to use when building the plugin"
23-
type: string
24-
required: true
25-
default: '1'
26-
version_extra:
27-
description: "Extra version for the SMF plugin"
28-
type: string
29-
required: true
30-
default: '0'
22+
description: "Patch version for the SMF plugin"
23+
type: number
24+
required: false
3125
build_linux:
3226
description: 'Build for Linux'
3327
type: boolean
@@ -44,16 +38,13 @@ on:
4438
workflow_call:
4539
inputs:
4640
version_major:
47-
type: string
41+
type: number
4842
required: true
4943
version_minor:
50-
type: string
44+
type: number
5145
required: true
5246
version_patch:
53-
type: string
54-
required: true
55-
version_extra:
56-
type: string
47+
type: number
5748
required: true
5849
build_linux:
5950
type: boolean
@@ -73,7 +64,6 @@ jobs:
7364
version_major: ${{ steps.defaults.outputs.version_major }}
7465
version_minor: ${{ steps.defaults.outputs.version_minor }}
7566
version_patch: ${{ steps.defaults.outputs.version_patch }}
76-
version_extra: ${{ steps.defaults.outputs.version_extra }}
7767
build_linux: ${{ steps.defaults.outputs.build_linux }}
7868
build_windows: ${{ steps.defaults.outputs.build_windows }}
7969
build_macos: ${{ steps.defaults.outputs.build_macos }}
@@ -82,13 +72,13 @@ jobs:
8272
- name: Set defaults
8373
id: defaults
8474
run: |
85-
echo "version_major=${{ inputs.version_major || '4' }}" >> $GITHUB_OUTPUT
86-
echo "version_minor=${{ inputs.version_minor || '6' }}" >> $GITHUB_OUTPUT
87-
echo "version_patch=${{ inputs.version_patch || '1' }}" >> $GITHUB_OUTPUT
88-
echo "version_extra=${{ inputs.version_extra || '0' }}" >> $GITHUB_OUTPUT
89-
echo "build_linux=${{ inputs.build_linux || 'true' }}" >> $GITHUB_OUTPUT
90-
echo "build_windows=${{ inputs.build_windows || 'true' }}" >> $GITHUB_OUTPUT
91-
echo "build_macos=${{ inputs.build_macos || 'true' }}" >> $GITHUB_OUTPUT
75+
echo "version_major=${{ inputs.version_major || 4 }}" >> $GITHUB_OUTPUT
76+
echo "version_minor=${{ inputs.version_minor || 6 }}" >> $GITHUB_OUTPUT
77+
echo "version_patch=${{ inputs.version_patch || -1 }}" >> $GITHUB_OUTPUT
78+
79+
echo "build_linux=${{ !contains(inputs.build_linux, 'false') }}" >> $GITHUB_OUTPUT
80+
echo "build_windows=${{ !contains(inputs.build_windows, 'false') }}" >> $GITHUB_OUTPUT
81+
echo "build_macos=${{ !contains(inputs.build_macos, 'false') }}" >> $GITHUB_OUTPUT
9282
9383
- name: Set OS Matrix
9484
id: set-matrix
@@ -130,10 +120,11 @@ jobs:
130120
needs: setup
131121
strategy:
132122
matrix:
133-
os: ${{ fromJson(needs.setup.outputs.matrix) }}
123+
os: ${{ fromJSON(needs.setup.outputs.matrix) }}
134124
name: Build on ${{ matrix.os.pretty-name }}
135125
env:
136126
WIRESHARK_BASE_DIR: ${{ github.workspace }}/wireshark-libs
127+
WIRESHARK_PATCH_VERSION: 0
137128
runs-on: ${{ matrix.os.runner }}
138129
steps:
139130
- name: Checkout
@@ -157,14 +148,14 @@ jobs:
157148
uses: actions/cache@v4
158149
with:
159150
path: ${{ env.WIRESHARK_BASE_DIR }}
160-
key: wireshark-libs-v${{ needs.setup.outputs.version_major }}.${{ needs.setup.outputs.version_minor }}.${{ needs.setup.outputs.version_patch }}-${{ matrix.os.name }}
151+
key: wireshark-libs-v${{ needs.setup.outputs.version_major }}.${{ needs.setup.outputs.version_minor }}.${{ env.WIRESHARK_PATCH_VERSION }}-${{ matrix.os.name }}
161152

162153
- name: Cache Wireshark Install
163154
id: cache-wireshark-install
164155
uses: actions/cache@v4
165156
with:
166157
path: wireshark-install
167-
key: wireshark-v${{ needs.setup.outputs.version_major }}.${{ needs.setup.outputs.version_minor }}.${{ needs.setup.outputs.version_patch }}${{ matrix.os.name == 'macos' && format('-glib{0}', steps.macos-deps-hash.outputs.GLIB_VER) || '' }}-${{ matrix.os.name }}
158+
key: wireshark-v${{ needs.setup.outputs.version_major }}.${{ needs.setup.outputs.version_minor }}.${{ env.WIRESHARK_PATCH_VERSION }}${{ matrix.os.name == 'macos' && format('-glib{0}', steps.macos-deps-hash.outputs.GLIB_VER) || '' }}-${{ matrix.os.name }}
168159

169160
- name: Create Wireshark Install Directory
170161
if: steps.cache-wireshark-install.outputs.cache-hit != 'true'
@@ -176,7 +167,7 @@ jobs:
176167
with:
177168
repository: wireshark/wireshark
178169
path: wireshark-src
179-
ref: v${{ needs.setup.outputs.version_major }}.${{ needs.setup.outputs.version_minor }}.${{ needs.setup.outputs.version_patch }}
170+
ref: v${{ needs.setup.outputs.version_major }}.${{ needs.setup.outputs.version_minor }}.${{ env.WIRESHARK_PATCH_VERSION }}
180171

181172
- name: Install Wireshark Dependencies
182173
if: steps.cache-wireshark-install.outputs.cache-hit != 'true' && matrix.os.deps
@@ -249,12 +240,11 @@ jobs:
249240
cmake -G Ninja -S . -B build
250241
-DCMAKE_PREFIX_PATH="${{ github.workspace }}/wireshark-install;${{ env.WS_DEP_PATH }}"
251242
-DCMAKE_BUILD_TYPE="RelWithDebInfo"
252-
-DWireshark_VERSION="${{ needs.setup.outputs.version_major }}.${{ needs.setup.outputs.version_minor }}.${{ needs.setup.outputs.version_patch }}"
243+
-DWireshark_VERSION="${{ needs.setup.outputs.version_major }}.${{ needs.setup.outputs.version_minor }}.${{ env.WIRESHARK_PATCH_VERSION }}"
253244
-DCMAKE_C_FLAGS="${{ matrix.os.c-flags }}"
254245
-DPLUGIN_VERSION_MAJOR=${{ needs.setup.outputs.version_major }}
255246
-DPLUGIN_VERSION_MINOR=${{ needs.setup.outputs.version_minor }}
256247
-DPLUGIN_VERSION_PATCH=${{ needs.setup.outputs.version_patch }}
257-
-DPLUGIN_VERSION_EXTRA=${{ needs.setup.outputs.version_extra }}
258248
259249
- name: Build Plugin
260250
run: cmake --build build

.github/workflows/create_release.yml

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,18 @@ on:
66
inputs:
77
version_major:
88
description: "Major version of the wireshark tag to use when building the plugin"
9+
type: number
910
required: true
10-
default: '4'
11+
default: 4
1112
version_minor:
1213
description: "Minor version of the wireshark tag to use when building the plugin"
14+
type: number
1315
required: true
14-
default: '6'
16+
default: 6
1517
version_patch:
16-
description: "Patch version of the wireshark tag to use when building the plugin"
18+
description: "Patch version for the SMF plugin"
19+
type: number
1720
required: true
18-
default: '1'
19-
version_extra:
20-
description: "Extra version for the SMF plugin"
21-
type: string
22-
required: true
23-
default: '0'
2421

2522
env:
2623
LINUX_PLUGIN_NAME: wireshark-smf-linux-x86_64.tar.gz
@@ -32,10 +29,9 @@ jobs:
3229
name: Build All Plugins
3330
uses: ./.github/workflows/build_plugin.yml
3431
with:
35-
version_major: ${{ inputs.version_major }}
36-
version_minor: ${{ inputs.version_minor }}
37-
version_patch: ${{ inputs.version_patch }}
38-
version_extra: ${{ inputs.version_extra }}
32+
version_major: ${{ fromJSON(inputs.version_major) }}
33+
version_minor: ${{ fromJSON(inputs.version_minor) }}
34+
version_patch: ${{ fromJSON(inputs.version_patch) }}
3935

4036
create_release:
4137
name: Create Draft Release
@@ -54,8 +50,8 @@ jobs:
5450
- name: Create Release
5551
uses: ncipollo/release-action@v1
5652
with:
57-
name: "Wireshark SMF Plugin ${{ inputs.version_major }}.${{ inputs.version_minor }}.${{ inputs.version_patch }}.${{ inputs.version_extra }}"
58-
tag: "${{ inputs.version_major }}.${{ inputs.version_minor }}.${{ inputs.version_patch }}.${{ inputs.version_extra }}"
53+
name: "Wireshark SMF Plugin ${{ inputs.version_major }}.${{ inputs.version_minor }}.${{ inputs.version_patch }}"
54+
tag: "${{ inputs.version_major }}.${{ inputs.version_minor }}.${{ inputs.version_patch }}"
5955
artifacts: "${{ env.LINUX_PLUGIN_NAME }}/*, ${{ env.WINDOWS_PLUGIN_NAME }}/*, ${{ env.MACOS_PLUGIN_NAME }}/*"
6056
bodyFile: "${{ github.workspace }}/.github/workflows/docs/wireshark_smf_${{ inputs.version_major }}-${{ inputs.version_minor }}-x_instructions.md"
6157
draft: true

CMakeLists.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,8 @@ set(PROJECT_VERSION "${WS_VERSION_MAJOR}.${WS_VERSION_MINOR}.${WS_VERSION_PATCH}
2222

2323
set(PLUGIN_VERSION_MAJOR "${WS_VERSION_MAJOR}" CACHE STRING "Major Version")
2424
set(PLUGIN_VERSION_MINOR "${WS_VERSION_MINOR}" CACHE STRING "Minor Version")
25-
set(PLUGIN_VERSION_PATCH "${WS_VERSION_PATCH}" CACHE STRING "Patch Version")
26-
set(PLUGIN_VERSION_EXTRA "0" CACHE STRING "Extra Version")
27-
set(PLUGIN_VERSION "${PLUGIN_VERSION_MAJOR}.${PLUGIN_VERSION_MINOR}.${PLUGIN_VERSION_PATCH}.${PLUGIN_VERSION_EXTRA}")
25+
set(PLUGIN_VERSION_PATCH "-1" CACHE STRING "Patch Version")
26+
set(PLUGIN_VERSION "${PLUGIN_VERSION_MAJOR}.${PLUGIN_VERSION_MINOR}.${PLUGIN_VERSION_PATCH}")
2827
message(STATUS "SMF plugin version set to: ${PLUGIN_VERSION}")
2928

3029
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
@@ -39,7 +38,7 @@ if(WIN32)
3938
set(MODULE_NAME "smf")
4039
set(MODULE_VERSION "${PLUGIN_VERSION}")
4140
string(REPLACE "." "," RC_VERSION "${PROJECT_VERSION},0")
42-
string(REPLACE "." "," RC_MODULE_VERSION "${MODULE_VERSION}")
41+
string(REPLACE "." "," RC_MODULE_VERSION "${MODULE_VERSION},0")
4342
set(MSVC_VARIANT "${CMAKE_GENERATOR}")
4443

4544
configure_file(plugin.rc.in ${CMAKE_BINARY_DIR}/plugin.rc @ONLY)

0 commit comments

Comments
 (0)