4040 CGO_ENABLED=0 go build -o fmeflow${{ matrix.exe-ext }} -ldflags="-X \"github.com/safesoftware/fmeflow-cli/cmd.appVersion=${{ env.APP_VERSION }}\""
4141
4242 - name : Upload artifact for later steps
43- uses : actions/upload-artifact@v3
43+ uses : actions/upload-artifact@v4
4444 with :
4545 name : fmeflow-${{ matrix.os }}-${{ matrix.arch }}
4646 path : fmeflow${{ matrix.exe-ext }}
@@ -78,39 +78,60 @@ jobs:
7878 runs-on : windows-latest
7979 steps :
8080 - name : Download
81- uses : actions/download-artifact@v3
81+ uses : actions/download-artifact@v4
8282 with :
8383 name : fmeflow-windows-amd64
8484
85+ - uses : azure/login@v2
86+ with :
87+ creds : ${{ secrets.AZURE_CREDENTIALS }}
88+
89+ - name : Whitelist GitHub Runner IP
90+ run : |
91+ $agentIP = (Invoke-WebRequest -Uri https://api.ipify.org/).Content
92+ az keyvault network-rule add -g "${{ secrets.AZURE_RESOURCE_GROUP }}" -n "${{ secrets.KEY_VAULT_NAME }}" --ip-address $agentIP --output none
93+ az keyvault network-rule wait -n "${{ secrets.KEY_VAULT_NAME }}" --updated --output none
94+
95+ - name : Install AzureSignTool
96+ run : |
97+ dotnet tool install --global AzureSignTool --version 6.0.1
98+
8599 - name : Sign
86- env :
87- CERTPASS : ${{secrets.PROD_WIN_CERTIFICATE_PWD}}
88- SIGNCERT : ${{secrets.PROD_WIN_CERTIFICATE}}
89100 run : |
90- # Create buffer from the BASE64 string of the PFX stored in the secret
91- $buffer = [System.Convert]::FromBase64String($env:SIGNCERT)
92- # Create new certificate object from the buffer and the certificate pass
93- $certificate = [System.Security.Cryptography.X509Certificates.X509Certificate2]::New($buffer, $env:CERTPASS)
94- Set-AuthenticodeSignature -HashAlgorithm SHA256 -Certificate $certificate -TimestampServer http://timestamp.digicert.com -FilePath fmeflow.exe
101+ azuresigntool sign -coe `
102+ --azure-key-vault-url https://${{ secrets.KEY_VAULT_NAME }}.vault.azure.net/ `
103+ --azure-key-vault-managed-identity `
104+ --azure-key-vault-tenant-id ${{ secrets.AZURE_TENANT_ID }} `
105+ --azure-key-vault-certificate '${{ secrets.AZURE_CERTIFICATE_NAME }}' `
106+ --file-digest SHA256 `
107+ --timestamp-rfc3161 http://timestamp.digicert.com `
108+ --timestamp-digest SHA256 `
109+ fmeflow.exe
110+
111+ - name : Remove IP from Key Vault firewall
112+ run : |
113+ $agentIP = (Invoke-WebRequest -Uri https://api.ipify.org/).Content
114+ az keyvault network-rule remove -g "${{ secrets.AZURE_RESOURCE_GROUP }}" -n "${{ secrets.KEY_VAULT_NAME }}" --ip-address $agentIP --output none
95115
96116 - name : Reupload artifact
97- uses : actions/upload-artifact@v3
117+ uses : actions/upload-artifact@v4
98118 with :
99119 name : fmeflow-windows-amd64
100120 path : fmeflow.exe
121+ overwrite : true
101122
102123 sign-macosx :
103124 name : Sign Mac Binaries
104125 needs : build-matrix
105- runs-on : macos-11
126+ runs-on : macos-14
106127 strategy :
107128 matrix :
108129 # sign both darwin/amd64, darwin/arm64
109130 os : [darwin]
110131 arch : [amd64, arm64]
111132 steps :
112133 - name : Download
113- uses : actions/download-artifact@v3
134+ uses : actions/download-artifact@v4
114135 with :
115136 name : fmeflow-${{ matrix.os }}-${{ matrix.arch }}
116137
@@ -169,10 +190,11 @@ jobs:
169190 xcrun notarytool submit "notarization.zip" --keychain-profile "notarytool-profile" --wait
170191
171192 - name : Reupload artifact
172- uses : actions/upload-artifact@v3
193+ uses : actions/upload-artifact@v4
173194 with :
174195 name : fmeflow-${{ matrix.os }}-${{ matrix.arch }}
175196 path : fmeflow
197+ overwrite : true
176198
177199 compress-files :
178200 name : Compress binaries and release
@@ -200,7 +222,7 @@ jobs:
200222 type : tar
201223 steps :
202224 - name : Checkout code
203- uses : actions/checkout@v3
225+ uses : actions/checkout@v4
204226 - name : Download
205227 uses : actions/download-artifact@v3
206228 with :
@@ -227,7 +249,7 @@ jobs:
227249 cat fmeflow-${{ matrix.os }}-${{ matrix.arch }}.${{ matrix.zip-ext }}.md5
228250
229251 # Add compressed files and md5 hashes to the release
230- - uses : AButler/upload-release-assets@v2 .0
252+ - uses : AButler/upload-release-assets@v3 .0
231253 with :
232254 files : ' *.md5;*.zip;*.tar.gz'
233255 repo-token : ${{ secrets.GITHUB_TOKEN }}
0 commit comments