NU3018 While signing on Github Actions Ubuntu #11525
-
Hi, I tried to use Github Actions for publishing my package but the signing is not working, the action runs on Ubuntu. Here is action YAML: name: Publish Nuget Package When Pre-Released
on:
release:
types: [prereleased]
jobs:
build:
runs-on: ubuntu-latest
env:
BUILD_CONFIG: 'Release'
PROJECT: 'src/OpenAPI.Net/OpenAPI.Net.csproj'
steps:
- uses: actions/checkout@v2
- name: Setup NuGet
uses: NuGet/[email protected]
with:
nuget-api-key: ${{secrets.NUGET_API_KEY}}
nuget-version: 'latest'
- name: Restore dependencies
run: nuget restore $PROJECT
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
- name: Build
run: dotnet build $PROJECT --configuration $BUILD_CONFIG --no-restore
- name: Set Execution Permission For decrypt_certificate.sh
run: chmod +x ./decrypt_certificate.sh
- name: Decrypt Certificate
run: ./decrypt_certificate.sh
env:
CERTIFICATE_GPG_PASSPHRASE: ${{secrets.CERTIFICATE_GPG_PASSPHRASE}}
- name: Importing Certificate
run: sudo cp $HOME/secrets/certificate.pfx /usr/share/ca-certificates/certificate.pfx ; sudo dpkg-reconfigure ca-certificates ; sudo update-ca-certificates ; git config --global http.sslCAInfo /usr/share/ca-certificates/certificate.pfx
- name: Sign Package
run: nuget sign **\*.nupkg -CertificatePath $HOME/secrets/certificate.pfx -Timestamper http://timestamp.digicert.com/ -CertificatePassword ${{secrets.CERTIFICATE_PASSWORD}} -NonInteractive
- name: Publish Package
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json'
- name: Publish Symbols
run: nuget push **\*.snupkg -Source 'https://api.nuget.org/v3/index.json'
And the error while it's running the Sign Package step:
I used the same certificate file on my local Windows system and it works fine without any issue. The certificate is not a self issued certificate. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Have you tried in a Linux VM, where you can run commands interactively, and do some debugging/investigating? I don't think that update-ca-certificates support pfx certs, and that you'll need to convert them to pem format using openssl. But I'm not 100% sure. So, my best guess is that your "Importing Certificate" step isn't working as you expect. |
Beta Was this translation helpful? Give feedback.
-
Anyone who is reading this in future, please check here. And thanks zivkan for replying back! |
Beta Was this translation helpful? Give feedback.
Anyone who is reading this in future, please check here.
And thanks zivkan for replying back!