Skip to content

Commit ceb0a21

Browse files
Adds code signing (#1123)
1 parent 637b5ce commit ceb0a21

File tree

2 files changed

+70
-4
lines changed

2 files changed

+70
-4
lines changed

.github/workflows/create-release.yml

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ on:
66
env:
77
REGISTRY: ghcr.io
88
IMAGE_NAME: ${{ github.repository }}
9-
IMAGE_DESCRIPTION: Dev Proxy is an API simulator that helps you effortlessly test your app beyond the happy path.
9+
APP_DESCRIPTION: Dev Proxy is an API simulator that helps you effortlessly test your app beyond the happy path.
10+
APP_PUBLISHER: Dev Proxy
11+
APP_DESCRIPTION_URL: https://aka.ms/devproxy
1012

1113
jobs:
1214
publish_binaries:
1315
name: Publish binaries
1416
runs-on: [windows-latest]
17+
environment:
18+
name: gh_releases
19+
permissions:
20+
id-token: write
21+
contents: read
1522
strategy:
1623
matrix:
1724
architecture:
@@ -60,7 +67,33 @@ jobs:
6067
Get-ChildItem -Filter *.pdb -Recurse | Remove-Item
6168
Get-ChildItem -Filter *.deps.json -Recurse | Remove-Item
6269
Get-ChildItem -Filter *.runtimeconfig.json -Recurse | Remove-Item
70+
Get-ChildItem -Filter *.staticwebassets.endpoints.json -Recurse | Remove-Item
71+
Get-ChildItem -Filter web.config -Recurse | Remove-Item
6372
popd
73+
- name: Install Sign CLI tool
74+
run: dotnet tool install --tool-path . sign --version 0.9.1-beta.25181.2
75+
- name: Azure CLI Login
76+
uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 # v2.3.0
77+
with:
78+
client-id: ${{ secrets.DOTNET_APPLICATION_ID }}
79+
tenant-id: ${{ secrets.DOTNET_TENANT_ID }}
80+
allow-no-subscriptions: true
81+
- name: Sign binaries
82+
if: contains(matrix.architecture, 'win-')
83+
working-directory: ./${{ env.release }}
84+
shell: pwsh
85+
run: >
86+
../sign code azure-key-vault
87+
**/dev*proxy*
88+
--publisher-name "${{ env.APP_PUBLISHER }}"
89+
--description "${{ env.APP_DESCRIPTION }}"
90+
--description-url "${{ env.APP_DESCRIPTION_URL }}"
91+
--azure-key-vault-tenant-id "${{ secrets.DOTNET_TENANT_ID }}"
92+
--azure-key-vault-client-id "${{ secrets.DOTNET_APPLICATION_ID }}"
93+
--azure-key-vault-certificate "${{ secrets.DOTNET_CERTIFICATE_NAME }}"
94+
--azure-key-vault-url "${{ secrets.DOTNET_VAULT_URL }}"
95+
--timestamp-url http://timestamp.digicert.com
96+
--verbosity Debug
6497
- name: Archive release ${{ env.release }}
6598
uses: thedoctor0/zip-release@a24011d8d445e4da5935a7e73c1f98e22a439464 # master
6699
with:
@@ -74,6 +107,21 @@ jobs:
74107
with:
75108
name: binaries-${{ env.release }}
76109
path: ./${{ env.release }}.zip
110+
- name: Sign abstractions
111+
if: matrix.architecture == 'win-x64'
112+
shell: pwsh
113+
run: >
114+
./sign code azure-key-vault
115+
./dev-proxy-abstractions/bin/Release/net9.0/dev-proxy-abstractions.dll
116+
--publisher-name "${{ env.APP_PUBLISHER }}"
117+
--description "${{ env.APP_DESCRIPTION }}"
118+
--description-url "${{ env.APP_DESCRIPTION_URL }}"
119+
--azure-key-vault-tenant-id "${{ secrets.DOTNET_TENANT_ID }}"
120+
--azure-key-vault-client-id "${{ secrets.DOTNET_APPLICATION_ID }}"
121+
--azure-key-vault-certificate "${{ secrets.DOTNET_CERTIFICATE_NAME }}"
122+
--azure-key-vault-url "${{ secrets.DOTNET_VAULT_URL }}"
123+
--timestamp-url http://timestamp.digicert.com
124+
--verbosity Debug
77125
- name: Archive abstractions
78126
if: matrix.architecture == 'win-x64'
79127
uses: thedoctor0/zip-release@a24011d8d445e4da5935a7e73c1f98e22a439464 # master
@@ -114,8 +162,24 @@ jobs:
114162
run: cp ./${{ steps.installer.outputs.filename }} ./${{ env.release }}
115163
- name: Build Installer
116164
if: contains(matrix.architecture, 'win-')
117-
run: ISCC.exe ${{ steps.installer.outputs.filename }} /F"dev-proxy-installer-${{ matrix.architecture }}-${{ github.ref_name }}"
165+
run: ISCC.exe ${{ steps.installer.outputs.filename }} /F"dev-proxy-installer-${{ matrix.architecture }}-${{ github.ref_name }}"
166+
working-directory: ./${{ env.release }}
167+
- name: Sign installer
168+
if: contains(matrix.architecture, 'win-')
118169
working-directory: ./${{ env.release }}
170+
shell: pwsh
171+
run: >
172+
../sign code azure-key-vault
173+
./dev-proxy-installer-*.exe
174+
--publisher-name "${{ env.APP_PUBLISHER }}"
175+
--description "${{ env.APP_DESCRIPTION }}"
176+
--description-url "${{ env.APP_DESCRIPTION_URL }}"
177+
--azure-key-vault-tenant-id "${{ secrets.DOTNET_TENANT_ID }}"
178+
--azure-key-vault-client-id "${{ secrets.DOTNET_APPLICATION_ID }}"
179+
--azure-key-vault-certificate "${{ secrets.DOTNET_CERTIFICATE_NAME }}"
180+
--azure-key-vault-url "${{ secrets.DOTNET_VAULT_URL }}"
181+
--timestamp-url http://timestamp.digicert.com
182+
--verbosity Debug
119183
- name: Upload Installer
120184
if: contains(matrix.architecture, 'win-')
121185
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
@@ -189,9 +253,9 @@ jobs:
189253
type=raw,value=latest,enable=${{ !contains(github.ref_name, '-beta') }}
190254
type=raw,value=beta,enable=${{ contains(github.ref_name, '-beta') }}
191255
labels: |
192-
org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }}
256+
org.opencontainers.image.description=${{ env.APP_DESCRIPTION }}
193257
annotations: |
194-
org.opencontainers.image.description=${{ env.IMAGE_DESCRIPTION }}
258+
org.opencontainers.image.description=${{ env.APP_DESCRIPTION }}
195259
- name: Build and push Docker image
196260
if: "!contains(github.ref_name, '-beta')"
197261
id: push

scripts/local-build.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@ cd ../bld
1717
Get-ChildItem -Filter *.pdb -Recurse | Remove-Item
1818
Get-ChildItem -Filter *.deps.json -Recurse | Remove-Item
1919
Get-ChildItem -Filter *.runtimeconfig.json -Recurse | Remove-Item
20+
Get-ChildItem -Filter *.staticwebassets.endpoints.json -Recurse | Remove-Item
21+
Get-ChildItem -Filter web.config -Recurse | Remove-Item
2022
popd

0 commit comments

Comments
 (0)