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