Skip to content

Use Azure subscription #8

Use Azure subscription

Use Azure subscription #8

Workflow file for this run

name: sign
on:
push:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v5
- name: setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
- name: build
run: dotnet build src --configuration Release --restore
- name: package
run: dotnet pack src --configuration Release --no-build -o ./artifacts
- name: artifact
uses: actions/upload-artifact@v5
with:
name: AcmeLibrary
path: artifacts
sign:
needs: build
permissions:
id-token: write
environment: production
runs-on: windows-latest
steps:
- name: setup dotnet
uses: actions/setup-dotnet@v5
with:
dotnet-version: '8.0.x'
- name: setup dotnet sign tool
run: dotnet tool install --tool-path . --prerelease sign
- name: download artifact
uses: actions/download-artifact@v5
with:
name: AcmeLibrary
path: artifacts
- name: azure login
uses: azure/login@v2
with:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
client-id: ${{ secrets.KEYVAULT_CLIENT_ID }}
tenant-id: ${{ secrets.KEYVAULT_TENANT_ID }}
- name: sign package
shell: pwsh
run: >
./sign code trusted-signing
**/*.nupkg
--base-directory "${{ github.workspace }}/artifacts"
--publisher-name "NetOffice Acme Sample"
--description "Sample workflow to sign using Azure Trusted Signing service."
--description-url "https://github.com/NetOfficeFw/trusted-signing/"
--trusted-signing-endpoint "${{ secrets.TRUSTED_SIGNING_ENDPOINT }}"
--trusted-signing-account "${{ secrets.TRUSTED_SIGNING_ACCOUNT }}"
--trusted-signing-certificate-profile "${{ secrets.TRUSTED_SIGNING_PROFILE }}"
--verbosity trace
- name: artifact
uses: actions/upload-artifact@v5
with:
name: AcmeLibrary-signed
path: artifacts