Skip to content

Commit 269bfa3

Browse files
vdyedscho
authored andcommitted
release: add signing step for .deb package
- sign using Azure-stored certificates & client - sign on Windows agent via python script - job skipped if credentials for accessing certificate aren't present
1 parent 5d27088 commit 269bfa3

File tree

1 file changed

+47
-2
lines changed

1 file changed

+47
-2
lines changed

.github/workflows/build-git-installers.yml

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
outputs:
1717
tag_name: ${{ steps.tag.outputs.name }} # The full name of the tag, e.g. v2.32.0.vfs.0.0
1818
tag_version: ${{ steps.tag.outputs.version }} # The version number (without preceding "v"), e.g. 2.32.0.vfs.0.0
19+
deb_signable: ${{ steps.deb.outputs.signable }} # Whether the credentials needed to sign the .deb package are available
1920
steps:
2021
- name: Validate tag
2122
run: |
@@ -29,6 +30,9 @@ jobs:
2930
echo "name=${GITHUB_REF#refs/tags/}" >>$GITHUB_OUTPUT
3031
echo "version=${GITHUB_REF#refs/tags/v}" >>$GITHUB_OUTPUT
3132
id: tag
33+
- name: Determine whether signing certificates are present
34+
run: echo "signable=$([[ $AZ_SUB != '' && $AZ_CREDS != '' ]] && echo 'true' || echo 'false')" >>$GITHUB_OUTPUT
35+
id: deb
3236
- name: Clone git
3337
uses: actions/checkout@v3
3438
- name: Validate the tag identified with trigger
@@ -571,7 +575,7 @@ jobs:
571575
path: git/.github/macos-installer/*.dmg
572576
# End build and sign Mac OSX installers
573577

574-
# Build unsigned Ubuntu package
578+
# Build & sign Ubuntu package
575579
ubuntu_build:
576580
runs-on: ubuntu-20.04
577581
needs: prereqs
@@ -647,4 +651,45 @@ jobs:
647651
with:
648652
name: deb-package-unsigned
649653
path: artifacts/
650-
# End build unsigned Ubuntu package
654+
ubuntu_sign-artifacts:
655+
runs-on: windows-latest # Must be run on Windows due to ESRP executable OS compatibility
656+
environment: release
657+
needs: [ubuntu_build, prereqs]
658+
if: needs.prereqs.outputs.deb_signable == 'true'
659+
env:
660+
ARTIFACTS_DIR: artifacts
661+
steps:
662+
- name: Clone repository
663+
uses: actions/checkout@v3
664+
with:
665+
path: 'git'
666+
- name: Download unsigned packages
667+
uses: actions/download-artifact@v3
668+
with:
669+
name: deb-package-unsigned
670+
path: unsigned
671+
- uses: azure/login@v1
672+
with:
673+
creds: ${{ secrets.AZURE_CREDENTIALS }}
674+
- name: Set up ESRP client
675+
shell: pwsh
676+
env:
677+
AZURE_VAULT: ${{ secrets.AZURE_VAULT }}
678+
AUTH_CERT: ${{ secrets.AZURE_VAULT_AUTH_CERT_NAME }}
679+
REQUEST_SIGNING_CERT: ${{ secrets.AZURE_VAULT_REQUEST_SIGNING_CERT_NAME }}
680+
run: |
681+
git\.github\scripts\set-up-esrp.ps1
682+
- name: Sign package
683+
shell: pwsh
684+
env:
685+
AZURE_AAD_ID: ${{ secrets.AZURE_AAD_ID }}
686+
LINUX_KEY_CODE: ${{ secrets.LINUX_KEY_CODE }}
687+
LINUX_OP_CODE: ${{ secrets.LINUX_OPERATION_CODE }}
688+
run: |
689+
python git\.github\scripts\run-esrp-signing.py unsigned $env:LINUX_KEY_CODE $env:LINUX_OP_CODE
690+
- name: Upload signed artifact
691+
uses: actions/upload-artifact@v3
692+
with:
693+
name: deb-package-signed
694+
path: signed
695+
# End build & sign Ubuntu package

0 commit comments

Comments
 (0)