Skip to content

windows testing

windows testing #19

name: Windows Signing
on:
- workflow_dispatch
- push
permissions:
id-token: write
contents: read
jobs:
prereqs:
name: Prerequisites
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Set version
run: echo "version=$(cat VERSION | sed -E 's/.[0-9]+$//')" >> $GITHUB_OUTPUT
id: version
# ================================
# Windows
# ================================
create-windows-release-assets:
name: Create Windows Release Assets
runs-on: windows-latest
environment: release
needs: prereqs
steps:
- uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v3.2.0
with:
dotnet-version: 7.0.x
- name: Build
run: |
dotnet build --configuration=WindowsRelease
- name: Run Windows unit tests
run: |
dotnet test --configuration=WindowsRelease
- name: Lay out Windows payload and symbols
run: |
cd $env:GITHUB_WORKSPACE\src\windows\Installer.Windows\
./layout.ps1 -Configuration WindowsRelease `
-Output $env:GITHUB_WORKSPACE\payload `
-SymbolOutput $env:GITHUB_WORKSPACE\symbols
# The AzureCodeSigning PowerShell module currently cannot handle files
# without extensions. This is a temporary workaround until the issue is
# fixed.
mkdir $env:GITHUB_WORKSPACE\incompatible-files
Get-ChildItem -Path $env:GITHUB_WORKSPACE\payload\* -Include NOTICE | Move-Item -Destination $env:GITHUB_WORKSPACE\incompatible-files
- name: Log into Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Sign payload files with Azure Code Signing
uses: azure/azure-code-signing-action@v0.2.20
with:
endpoint: https://wus2.codesigning.azure.net/
code-signing-account-name: git-fundamentals-signing
certificate-profile-name: git-fundamentals-windows-signing
files-folder: ${{ github.workspace }}\payload
files-folder-filter: exe,dll
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Build with signed payload
shell: pwsh
env:
DOTNET_ROOT: '%PROGRAMFILES%\dotnet'
run: |
Get-ChildItem -Path $env:GITHUB_WORKSPACE\incompatible-files -Include NOTICE | Move-Item -Destination payload
dotnet build $env:GITHUB_WORKSPACE\src\windows\Installer.Windows `
/p:PayloadPath=$env:GITHUB_WORKSPACE\payload /p:NoLayout=true `
--configuration=WindowsRelease --output=$env:GITHUB_WORKSPACE\installers
- name: Sign installers with Azure Code Signing
uses: azure/azure-code-signing-action@v0.2.20
with:
endpoint: https://wus2.codesigning.azure.net/
code-signing-account-name: git-fundamentals-signing
certificate-profile-name: git-fundamentals-windows-signing
files-folder: ${{ github.workspace }}\installers
files-folder-filter: exe
file-digest: SHA256
timestamp-rfc3161: http://timestamp.acs.microsoft.com
timestamp-digest: SHA256
- name: Publish final artifacts
uses: actions/upload-artifact@v3
with:
name: windows-aritfacts
path: |
payload
installers
symbols