-
Notifications
You must be signed in to change notification settings - Fork 1
feat: adding Nuget signing workflow #29
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
e404ba7
c33cd29
e48b302
71ff744
a542129
2084359
46e24dd
617a3a8
2f13b9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ on: | |
| workflow_call: | ||
| inputs: | ||
| artifact-glob: | ||
| description: Glob pattern to match artifacts to sign (e.g. dist/**/*.{jar,deb,rpm}) | ||
| description: Glob pattern to match artifacts to sign (e.g. dist/**/*.{jar,deb,rpm,nupkg}) | ||
| required: true | ||
| type: string | ||
| output-dir: | ||
|
|
@@ -17,16 +17,45 @@ on: | |
| required: false | ||
| type: number | ||
| default: 7 | ||
| enable-nuget-signing: | ||
| description: Enable SSL.com signing for NuGet packages | ||
| required: false | ||
| type: boolean | ||
| default: false | ||
| nuget-environment: | ||
| description: SSL.com environment name for NuGet signing | ||
| required: false | ||
| type: string | ||
| default: PROD | ||
| jvm-max-memory: | ||
| description: Maximum JVM memory for NuGet signing process | ||
| required: false | ||
| type: string | ||
| default: 1024M | ||
| secrets: | ||
| gpg-private-key: | ||
| required: true | ||
| gpg-public-key: | ||
| required: true | ||
| gpg-key-pass: | ||
| required: true | ||
| es-username: | ||
| description: SSL.com username for NuGet signing | ||
| required: false | ||
| es-password: | ||
| description: SSL.com password for NuGet signing | ||
| required: false | ||
| credential-id: | ||
| description: SSL.com credential ID for NuGet signing | ||
| required: false | ||
| es-totp-secret: | ||
| description: SSL.com TOTP secret for NuGet signing | ||
| required: false | ||
|
|
||
| permissions: | ||
| contents: read | ||
| packages: read | ||
|
|
||
| jobs: | ||
| sign: | ||
| runs-on: ubuntu-22.04 | ||
|
|
@@ -44,10 +73,54 @@ jobs: | |
| run: | | ||
| sudo apt-get update && sudo apt-get install dpkg-sig dpkg-dev -y | ||
|
|
||
| - name: Sign Artifacts | ||
| - name: Sign Artifacts with GPG | ||
| run: | | ||
| chmod +x ${{ github.workspace }}/.github/workflows/sign-artifacts/entrypoint.sh | ||
| ${{ github.workspace }}/.github/workflows/sign-artifacts/entrypoint.sh "${{ inputs.artifact-glob }}" "${{ inputs.output-dir }}" | ||
|
|
||
| - name: Check for NuGet packages and sign if enabled | ||
| if: inputs.enable-nuget-signing | ||
| run: | | ||
| echo "Checking for NuGet packages..." | ||
| NUGET_PACKAGES=$(find "${{ inputs.output-dir }}" -name "*.nupkg" -type f) | ||
| if [ -n "$NUGET_PACKAGES" ]; then | ||
| echo "Found NuGet packages, signing with SSL.com..." | ||
| echo "$NUGET_PACKAGES" | while read -r file; do | ||
| echo "Signing: $file" | ||
| done | ||
| else | ||
| echo "No NuGet packages found" | ||
| fi | ||
|
|
||
| - name: Sign NuGet Packages with SSL.com | ||
| if: inputs.enable-nuget-signing | ||
| uses: sslcom/esigner-codesign@a272724cb13abe0abc579c6c40f7899969b6942b | ||
| with: | ||
| command: sign | ||
| username: ${{secrets.es-username}} | ||
| password: ${{secrets.es-password}} | ||
| credential_id: ${{secrets.credential-id}} | ||
| totp_secret: ${{secrets.es-totp-secret}} | ||
| file_path: ${{ inputs.output-dir }}/**/*.nupkg | ||
| output_path: ${{github.workspace}}/${{ inputs.output-dir }} | ||
| malware_block: false | ||
| override: false | ||
| environment_name: ${{ inputs.nuget-environment }} | ||
| clean_logs: true | ||
| jvm_max_memory: ${{ inputs.jvm-max-memory }} | ||
| signing_method: v1 | ||
|
|
||
| - name: Verify NuGet Packages (if NuGet signing was performed) | ||
|
||
| if: inputs.enable-nuget-signing | ||
| run: | | ||
| echo "Verifying signed NuGet packages..." | ||
| if [ -d "${{ inputs.output-dir }}" ]; then | ||
| find "${{ inputs.output-dir }}" -name "*.nupkg" -type f | while read -r file; do | ||
| echo "Verifying: $file" | ||
| dotnet nuget verify "$file" --all || echo "Warning: Could not verify $file" | ||
| done | ||
| fi | ||
|
|
||
| - name: Upload Artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,7 +40,6 @@ echo "Processing all files in target directory: $TARGET_DIR" | |
| find "$TARGET_DIR" -type f | while read -r file; do | ||
| echo "Processing: $file" | ||
|
|
||
|
|
||
| # Skip signature and checksum files to prevent infinite loops | ||
| if [[ "$file" =~ \.(asc|sha256)$ ]]; then | ||
| continue | ||
|
|
@@ -80,8 +79,13 @@ find "$TARGET_DIR" -type f | while read -r file; do | |
| # SHA256 checksum for signature file | ||
| shasum -a 256 "$file.asc" > "$file.asc.sha256" | ||
|
|
||
| echo "Signed: $file" | ||
| echo "GPG Signed: $file" | ||
| echo " Signature: $file.asc" | ||
| echo " Checksum: $file.sha256" | ||
| echo " Sig Checksum: $file.asc.sha256" | ||
|
|
||
| # Note about NuGet packages | ||
| if [[ "$ext" == "nupkg" ]]; then | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would it be better to change the logic of the script to only pick up files it could sign, aka, this bash script only signs rpms, and debs right? Or is this echo important? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i added the nuget signing to the reusable-sign artifacts file. so this just confirms if theres a nupkg to be signed if not it skips the signing |
||
| echo " Note: NuGet package detected - will be signed by SSL.com if enabled in workflow" | ||
| fi | ||
| done | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,5 @@ | ||
| { | ||
| "yaml.schemas": {}, | ||
| "cSpell.words": [ | ||
| "aerospike", | ||
| "kennylong", | ||
| "kennylong's" | ||
| ], | ||
| "cSpell.words": ["aerospike", "kennylong", "kennylong's"], | ||
| "postman.settings.dotenv-detection-notification-visibility": false | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the step after this not actually list out the files that it signs? this seems like a weird step? Just here to print information out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous commit had an all in one workflow that built the packages then signed them, the build step was removed.