3939 echo 'Running build script: Windows'
4040 cd Yubico.NativeShims
4141 & ./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"
4254 - uses : actions/upload-artifact@v4
4355 with :
4456 name : win-x64
7183 echo 'Running build script: Linux (amd64)'
7284 cd Yubico.NativeShims
7385 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"
7495 - uses : actions/upload-artifact@v4
7596 with :
7697 name : linux-x64
@@ -85,6 +106,15 @@ jobs:
85106 echo 'Running build script: Linux (arm64)'
86107 cd Yubico.NativeShims
87108 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"
88118 - uses : actions/upload-artifact@v4
89119 with :
90120 name : linux-arm64
@@ -99,6 +129,15 @@ jobs:
99129 echo 'Running build script: macOS'
100130 cd Yubico.NativeShims
101131 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"
102141 - uses : actions/upload-artifact@v4
103142 with :
104143 name : osx-x64
0 commit comments