Skip to content

Try to sign NuGet package from GitHub Actions #1539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/sign-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Try-GHA-PKG-Sign

on:
workflow_dispatch:
push:
branches:
- main
- '[0-9]+.x'
- 'release/*'
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: true

jobs:
sign:
runs-on: windows-latest
permissions:
id-token: write

steps:
- name: Git checkout
uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.*
9.0.*

- name: Install code signing tool
run: dotnet tool install --global sign --prerelease

- name: Sign packages
shell: pwsh
run: >-
sign code azure-key-vault "**/*.nupkg"
--base-directory "${{ github.workspace }}"
--azure-key-vault-url "${{ secrets.AZURE_KEY_VAULT_URL }}"
--azure-key-vault-tenant-id "${{ secrets.AZURE_KEY_VAULT_TENANT_ID }}"
--azure-key-vault-client-id "${{ secrets.AZURE_KEY_VAULT_CLIENT_ID }}"
--azure-key-vault-client-secret "${{ secrets.AZURE_KEY_VAULT_CLIENT_SECRET }}"
--azure-key-vault-certificate "${{ secrets.AZURE_KEY_VAULT_CERTIFICATE_ID }}"
--description "Steeltoe"

- name: "TEMP: Upload signed packages"
uses: actions/upload-artifact@v4
with:
name: signed-packages
path: ${{ github.workspace }}/**/*.nupkg
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,6 @@ publish/
# in these scripts will be unencrypted
PublishScripts/

# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
Expand Down
Binary file added Steeltoe.Common.4.0.633-beta-ge14e7a3419.nupkg
Binary file not shown.
Loading