forked from git-ecosystem/git-credential-manager
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b10122e
commit 99b4633
Showing
1 changed file
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
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: 6.0.x | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: | | ||
dotnet build --configuration=WindowsRelease | ||
- name: Run Windows unit tests | ||
run: | | ||
dotnet test --configuration=WindowsRelease | ||
- name: Lay out Windows payload and symbols | ||
shell: pwsh | ||
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 | ||
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 |