|
5 | 5 | tags:
|
6 | 6 | - 'v[0-9]*vfs*' # matches "v<number><any characters>vfs<any characters>"
|
7 | 7 |
|
| 8 | +permissions: |
| 9 | + id-token: write # required for Azure login via OIDC |
| 10 | + |
8 | 11 | env:
|
9 | 12 | DO_WIN_CODESIGN: ${{ secrets.WIN_CODESIGN_CERT_SECRET_NAME != '' && secrets.WIN_CODESIGN_PASS_SECRET_NAME != '' }}
|
10 | 13 | DO_WIN_GPGSIGN: ${{ secrets.WIN_GPG_KEYGRIP_SECRET_NAME != '' && secrets.WIN_GPG_PRIVATE_SECRET_NAME != '' && secrets.WIN_GPG_PASSPHRASE_SECRET_NAME != '' }}
|
@@ -537,7 +540,7 @@ jobs:
|
537 | 540 | git/.github/macos-installer/*.pkg
|
538 | 541 | # End build and sign Mac OSX installers
|
539 | 542 |
|
540 |
| - # Build unsigned Ubuntu package |
| 543 | + # Build and sign Debian package |
541 | 544 | create-linux-unsigned-artifacts:
|
542 | 545 | runs-on: ubuntu-latest
|
543 | 546 | container:
|
@@ -630,10 +633,68 @@ jobs:
|
630 | 633 | # Move Debian package for later artifact upload
|
631 | 634 | mv "$PKGNAME.deb" "$GITHUB_WORKSPACE"
|
632 | 635 |
|
| 636 | + - name: Upload artifacts |
| 637 | + uses: actions/upload-artifact@v4 |
| 638 | + with: |
| 639 | + name: linux-unsigned-artifacts |
| 640 | + path: | |
| 641 | + *.deb |
| 642 | +
|
| 643 | + create-linux-artifacts: |
| 644 | + runs-on: ubuntu-latest |
| 645 | + needs: [prereqs, create-linux-unsigned-artifacts] |
| 646 | + environment: release |
| 647 | + steps: |
| 648 | + - name: Log into Azure |
| 649 | + uses: azure/login@v2 |
| 650 | + with: |
| 651 | + client-id: ${{ secrets.AZURE_CLIENT_ID }} |
| 652 | + tenant-id: ${{ secrets.AZURE_TENANT_ID }} |
| 653 | + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} |
| 654 | + |
| 655 | + - name: Check out repository (for akv-secret Action) |
| 656 | + uses: actions/checkout@v4 |
| 657 | + with: |
| 658 | + path: git |
| 659 | + |
| 660 | + - name: Download GPG secrets |
| 661 | + id: gpg-secrets |
| 662 | + uses: ./git/.github/actions/akv-secret |
| 663 | + with: |
| 664 | + vault: ${{ secrets.AZURE_VAULT }} |
| 665 | + secrets: | |
| 666 | + ${{ secrets.LINUX_GPG_KEYGRIP_SECRET_NAME }} > $output:keygrip |
| 667 | + ${{ secrets.LINUX_GPG_PRIVATE_SECRET_NAME }} base64> $output:private-key |
| 668 | + ${{ secrets.LINUX_GPG_PASSPHRASE_SECRET_NAME }} > $output:passphrase |
| 669 | +
|
| 670 | + - name: Prepare for GPG signing |
| 671 | + run: | |
| 672 | + # Install debsigs |
| 673 | + sudo apt-get install -y debsigs |
| 674 | +
|
| 675 | + # Import GPG key |
| 676 | + echo -n '${{ steps.gpg-secrets.outputs.private-key }}' | gpg --import --no-tty --batch --yes |
| 677 | +
|
| 678 | + # Configure GPG |
| 679 | + echo "allow-preset-passphrase" > ~/.gnupg/gpg-agent.conf |
| 680 | + gpg-connect-agent RELOADAGENT /bye |
| 681 | + /usr/lib/gnupg2/gpg-preset-passphrase --preset '${{ steps.gpg-secrets.outputs.keygrip }}' <<<'${{ steps.gpg-secrets.outputs.passphrase }}' |
| 682 | +
|
| 683 | + - name: Download artifacts |
| 684 | + uses: actions/download-artifact@v4 |
| 685 | + with: |
| 686 | + name: linux-unsigned-artifacts |
| 687 | + |
| 688 | + - name: Sign Debian package |
| 689 | + run: | |
| 690 | + # Sign Debian package |
| 691 | + version="${{ needs.prereqs.outputs.tag_version }}" |
| 692 | + debsigs --sign=origin --verify --check microsoft-git_"$version".deb |
| 693 | +
|
633 | 694 | - name: Upload artifacts
|
634 | 695 | uses: actions/upload-artifact@v4
|
635 | 696 | with:
|
636 | 697 | name: linux-artifacts
|
637 | 698 | path: |
|
638 | 699 | *.deb
|
639 |
| - # End build unsigned Debian package |
| 700 | + # End build and sign Debian package |
0 commit comments