@@ -38,19 +38,12 @@ jobs:
3838 - run : |
3939 echo 'Running build script: Windows'
4040 cd Yubico.NativeShims
41- & ./build-windows.ps1
42- - name : Set version
43- if : github.event.inputs.version
44- shell : pwsh
45- run : |
46- $version = "${{ github.event.inputs.version }}"
47- # Update CMakeLists.txt
48- (Get-Content Yubico.NativeShims/CMakeLists.txt) -replace 'project\(Yubico.NativeShims VERSION [^)]+\)', "project(Yubico.NativeShims VERSION $version)" | Set-Content Yubico.NativeShims/CMakeLists.txt
49- # Update vcpkg.json
50- $vcpkg = Get-Content Yubico.NativeShims/vcpkg.json -Raw | ConvertFrom-Json
51- $vcpkg.version = $version
52- $vcpkg | ConvertTo-Json | Set-Content Yubico.NativeShims/vcpkg.json
53- echo "Set version to $version"
41+ if ("${{ github.event.inputs.version }}" -ne "") {
42+ $baseVersion = "${{ github.event.inputs.version }}".Split('-')[0]
43+ & ./build-windows.ps1 -Version $baseVersion
44+ } else {
45+ & ./build-windows.ps1
46+ }
5447 - uses : actions/upload-artifact@v4
5548 with :
5649 name : win-x64
@@ -82,16 +75,12 @@ jobs:
8275 - run : |
8376 echo 'Running build script: Linux (amd64)'
8477 cd Yubico.NativeShims
85- sh ./build-linux-amd64.sh
86- - name : Set version
87- if : github.event.inputs.version
88- run : |
89- VERSION=${{ github.event.inputs.version }}
90- # Update CMakeLists.txt
91- sed -i "s/project(Yubico.NativeShims VERSION [^)]*)/project(Yubico.NativeShims VERSION $VERSION)/" Yubico.NativeShims/CMakeLists.txt
92- # Update vcpkg.json
93- jq --arg v "$VERSION" '.version = $v' Yubico.NativeShims/vcpkg.json > tmp.json && mv tmp.json Yubico.NativeShims/vcpkg.json
94- echo "Set version to $VERSION"
78+ if [ ! -z "${{ github.event.inputs.version }}" ]; then
79+ BASE_VERSION=$(echo "${{ github.event.inputs.version }}" | cut -d'-' -f1)
80+ sh ./build-linux-amd64.sh "$BASE_VERSION"
81+ else
82+ sh ./build-linux-amd64.sh
83+ fi
9584 - uses : actions/upload-artifact@v4
9685 with :
9786 name : linux-x64
@@ -105,16 +94,12 @@ jobs:
10594 - run : |
10695 echo 'Running build script: Linux (arm64)'
10796 cd Yubico.NativeShims
108- sh ./build-linux-arm64.sh
109- - name : Set version
110- if : github.event.inputs.version
111- run : |
112- VERSION=${{ github.event.inputs.version }}
113- # Update CMakeLists.txt
114- sed -i "s/project(Yubico.NativeShims VERSION [^)]*)/project(Yubico.NativeShims VERSION $VERSION)/" Yubico.NativeShims/CMakeLists.txt
115- # Update vcpkg.json
116- jq --arg v "$VERSION" '.version = $v' Yubico.NativeShims/vcpkg.json > tmp.json && mv tmp.json Yubico.NativeShims/vcpkg.json
117- echo "Set version to $VERSION"
97+ if [ ! -z "${{ github.event.inputs.version }}" ]; then
98+ BASE_VERSION=$(echo "${{ github.event.inputs.version }}" | cut -d'-' -f1)
99+ sh ./build-linux-arm64.sh "$BASE_VERSION"
100+ else
101+ sh ./build-linux-arm64.sh
102+ fi
118103 - uses : actions/upload-artifact@v4
119104 with :
120105 name : linux-arm64
@@ -128,16 +113,12 @@ jobs:
128113 - run : |
129114 echo 'Running build script: macOS'
130115 cd Yubico.NativeShims
131- sh ./build-macOS.sh
132- - name : Set version
133- if : github.event.inputs.version
134- run : |
135- VERSION=${{ github.event.inputs.version }}
136- # Update CMakeLists.txt
137- sed -i "s/project(Yubico.NativeShims VERSION [^)]*)/project(Yubico.NativeShims VERSION $VERSION)/" Yubico.NativeShims/CMakeLists.txt
138- # Update vcpkg.json
139- jq --arg v "$VERSION" '.version = $v' Yubico.NativeShims/vcpkg.json > tmp.json && mv tmp.json Yubico.NativeShims/vcpkg.json
140- echo "Set version to $VERSION"
116+ if [ ! -z "${{ github.event.inputs.version }}" ]; then
117+ BASE_VERSION=$(echo "${{ github.event.inputs.version }}" | cut -d'-' -f1)
118+ sh ./build-macOS.sh "$BASE_VERSION"
119+ else
120+ sh ./build-macOS.sh
121+ fi
141122 - uses : actions/upload-artifact@v4
142123 with :
143124 name : osx-x64
0 commit comments