vbamc v1.7.0 #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
on: | |
push: | |
tags: [ 'v*.*.*' ] | |
permissions: | |
contents: read | |
env: | |
DOTNET_NOLOGO: 1 | |
DOTNET_CLI_TELEMETRY_OPTOUT: 1 | |
DOTNET_GENERATE_ASPNET_CERTIFICATE: 0 | |
RestoreLockedMode: true | |
Configuration: Release | |
RepositoryBranch: '${{ github.ref_name }}' | |
RepositoryCommit: '${{ github.sha }}' | |
jobs: | |
build: | |
runs-on: windows-2022 | |
steps: | |
- name: checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7 | |
- name: setup AzureSignTool | |
if: steps.cache-dotnettools.outputs.cache-hit != 'true' | |
run: dotnet tool install --verbosity minimal --global azuresigntool --version 4.0.1 | |
- name: setup NuGetKeyVaultSignTool | |
if: steps.cache-dotnettools.outputs.cache-hit != 'true' | |
run: dotnet tool install --verbosity minimal --global NuGetKeyVaultSignTool --version 3.2.2 | |
- name: restore | |
run: dotnet restore | |
- name: build | |
run: dotnet build --no-restore | |
- name: test | |
run: dotnet test --no-restore --no-build | |
- name: sign libraries | |
id: sign_library | |
if: ${{ success() && github.event_name == 'push' }} | |
working-directory: '${{ github.workspace}}' | |
run: | | |
AzureSignTool.exe sign ` | |
--file-digest sha256 ` | |
--description-url "https://github.com/NetOfficeFw/vbamc" ` | |
--no-page-hashing ` | |
--timestamp-rfc3161 http://timestamp.digicert.com ` | |
--timestamp-digest sha256 ` | |
--azure-key-vault-url "${{ secrets.KEYVAULT_URL }}" ` | |
--azure-key-vault-tenant-id "${{ secrets.KEYVAULT_TENANT_ID }}" ` | |
--azure-key-vault-client-id "${{ secrets.KEYVAULT_CLIENT_ID }}" ` | |
--azure-key-vault-client-secret "${{ secrets.AZURESIGNTOOL_CLIENT_SECRET }}" ` | |
--azure-key-vault-certificate "goITSolutions-until-2024-01" ` | |
--verbose ` | |
src/VbaCompiler/bin/Release/net6.0/VbaCompiler.dll ` | |
src/VbaCompiler/bin/Release/net7.0/VbaCompiler.dll ` | |
src/vbamc/obj/Release/net6.0/vbamc.dll ` | |
src/vbamc/obj/Release/net7.0/vbamc.dll | |
- name: pack | |
if: ${{ always() }} | |
run: | | |
dotnet pack src/VbaCompiler/VbaCompiler.csproj --no-build --no-restore -o dist | |
dotnet pack src/vbamc/vbamc.csproj --no-build --no-restore -o dist | |
- name: sign packages | |
id: sign_package | |
if: ${{ steps.sign_library.outcome == 'success' }} | |
working-directory: '${{ github.workspace}}/dist' | |
run: | | |
NuGetKeyVaultSignTool.exe sign *.nupkg ` | |
--file-digest sha256 ` | |
--timestamp-rfc3161 http://timestamp.digicert.com ` | |
--timestamp-digest sha256 ` | |
--azure-key-vault-url "${{ secrets.KEYVAULT_URL }}" ` | |
--azure-key-vault-tenant-id "${{ secrets.KEYVAULT_TENANT_ID }}" ` | |
--azure-key-vault-client-id "${{ secrets.KEYVAULT_CLIENT_ID }}" ` | |
--azure-key-vault-client-secret "${{ secrets.AZURESIGNTOOL_CLIENT_SECRET }}" ` | |
--azure-key-vault-certificate "goITSolutions-until-2024-01" | |
- name: publish packages | |
if: ${{ steps.sign_package.outcome == 'success' }} | |
working-directory: '${{ github.workspace}}/dist' | |
run: | | |
dotnet nuget push "*.nupkg" --api-key $env:NUGET_PUSH_KEY --source https://api.nuget.org/v3/index.json | |
env: | |
NUGET_PUSH_KEY: ${{ secrets.NUGET_PUSH_KEY }} | |
- name: publish artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: vbamc_build_${{ github.run_id }}_preview${{ github.run_number }} | |
path: '${{ github.workspace }}/dist' |