-
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
Open
svivesaero
wants to merge
9
commits into
main
Choose a base branch
from
nuget_signing
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
e404ba7
feat: adding Nuget signing workflow
c33cd29
updating trunk errors
svivesaero e48b302
feat(workflows): integrate NuGet signing into reusable sign-artifacts…
svivesaero 71ff744
fix: resolve merge conflicts in reusable_sign-artifacts.yaml
svivesaero a542129
feat: extract nuget signing workflow from reusable workflow
svivesaero 2084359
fix: improve nuget package detection and error handling
svivesaero 46e24dd
fix: handle relative output paths in nuget signing workflow
svivesaero 617a3a8
fix: improve path handling for artifact-glob input
svivesaero 2f13b9a
feat: add download-artifact-name input to support downloading artifac…
svivesaero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
name: Sign NuGet Artifacts | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
artifact-glob: | ||
description: Directory path containing NuGet packages to sign (e.g. ./sign or ./artifacts) | ||
required: true | ||
type: string | ||
output-path: | ||
description: Output directory for signed packages (e.g. ./artifacts or full path) | ||
required: false | ||
type: string | ||
default: ${{ github.workspace }} | ||
artifact-name: | ||
description: Name for the uploaded artifacts | ||
required: false | ||
type: string | ||
default: signed-nuget-artifacts | ||
retention-days: | ||
description: Retention days for the artifacts | ||
required: false | ||
type: number | ||
default: 7 | ||
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 | ||
malware-block: | ||
description: Enable malware blocking during signing | ||
required: false | ||
type: boolean | ||
default: false | ||
override: | ||
description: Override existing signatures | ||
required: false | ||
type: boolean | ||
default: false | ||
runs-on: | ||
description: The runner to use for the build | ||
required: false | ||
type: string | ||
default: ubuntu-latest | ||
download-artifact-name: | ||
description: Name of the artifact to download before signing (optional) | ||
required: false | ||
type: string | ||
secrets: | ||
ES_USERNAME: | ||
description: SSL.com username for NuGet signing | ||
required: true | ||
ES_PASSWORD: | ||
description: SSL.com password for NuGet signing | ||
required: true | ||
CREDENTIAL_ID: | ||
description: SSL.com credential ID for NuGet signing | ||
required: true | ||
ES_TOTP_SECRET: | ||
description: SSL.com TOTP secret for NuGet signing | ||
required: true | ||
|
||
permissions: | ||
contents: read | ||
packages: read | ||
|
||
jobs: | ||
sign-nuget: | ||
runs-on: ${{ inputs.runs-on }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Download artifacts (if specified) | ||
if: ${{ inputs.download-artifact-name != '' }} | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.download-artifact-name }} | ||
path: ${{ inputs.artifact-glob }} | ||
|
||
- name: Check for NuGet packages | ||
run: | | ||
echo "Checking for NuGet packages in: ${{ inputs.artifact-glob }}" | ||
echo "Current working directory: $(pwd)" | ||
echo "Workspace directory: ${{ github.workspace }}" | ||
|
||
# Handle both relative and absolute paths | ||
if [[ "${{ inputs.artifact-glob }}" == /* ]]; then | ||
SEARCH_PATH="${{ inputs.artifact-glob }}" | ||
else | ||
SEARCH_PATH="${{ github.workspace }}/${{ inputs.artifact-glob }}" | ||
fi | ||
|
||
echo "Searching in: $SEARCH_PATH" | ||
NUGET_PACKAGES=$(find "$SEARCH_PATH" -name "*.nupkg" -type f 2>/dev/null || echo "") | ||
if [ -n "$NUGET_PACKAGES" ]; then | ||
echo "Found NuGet packages:" | ||
echo "$NUGET_PACKAGES" | ||
else | ||
echo "No NuGet packages found in $SEARCH_PATH" | ||
echo "Directory contents:" | ||
ls -la "$SEARCH_PATH" 2>/dev/null || echo "Directory does not exist" | ||
exit 1 | ||
fi | ||
|
||
- name: Sign NuGet Packages with SSL.com | ||
uses: sslcom/esigner-codesign@a272724cb13abe0abc579c6c40f7899969b6942b | ||
with: | ||
command: batch_sign | ||
username: ${{secrets.ES_USERNAME}} | ||
password: ${{secrets.ES_PASSWORD}} | ||
credential_id: ${{secrets.CREDENTIAL_ID}} | ||
totp_secret: ${{secrets.ES_TOTP_SECRET}} | ||
dir_path: ${{ inputs.artifact-glob }} | ||
output_path: ${{ inputs.output-path == 'artifacts' && format('{0}/artifacts', github.workspace) || inputs.output-path || github.workspace }} | ||
malware_block: ${{ inputs.malware-block || false }} | ||
override: ${{ inputs.override || false }} | ||
|
||
environment_name: ${{ inputs.nuget-environment }} | ||
clean_logs: true | ||
jvm_max_memory: ${{ inputs.jvm-max-memory }} | ||
signing_method: v1 | ||
|
||
- name: Verify NuGet Packages | ||
run: | | ||
echo "Verifying signed NuGet packages..." | ||
OUTPUT_DIR="${{ inputs.output-path == 'artifacts' && format('{0}/artifacts', github.workspace) || inputs.output-path || github.workspace }}" | ||
if [ -d "$OUTPUT_DIR" ]; then | ||
find "$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 Signed NuGet Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact-name }} | ||
path: ${{ inputs.output-path == 'artifacts' && format('{0}/artifacts', github.workspace) || inputs.output-path || github.workspace }} | ||
retention-days: ${{ inputs.retention-days }} |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"yaml.schemas": {}, | ||
"cSpell.words": ["aerospike", "kennylong", "kennylong's"] | ||
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. This looks like there is a war between formatters but please use the default trunk from this repository. 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. updated |
||
"cSpell.words": ["aerospike", "kennylong", "kennylong's"], | ||
"postman.settings.dotenv-detection-notification-visibility": false | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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 comment
The 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