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