-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2aa4d40
commit fd8af7d
Showing
2 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/bash | ||
|
||
echo "Executing post-success scripts for branch $GITHUB_REF_NAME" | ||
echo "Starting build and NuGet package creation for Paralax.CQRS.EventSourcing..." | ||
|
||
cd src/Paralax.CQRS.EventSourcing/src | ||
|
||
echo "Restoring NuGet packages..." | ||
dotnet restore | ||
|
||
PACKAGE_VERSION="1.0.$GITHUB_RUN_NUMBER" | ||
echo "Building and packing the Paralax.CQRS.EventSourcing library..." | ||
dotnet pack -c release /p:PackageVersion=$PACKAGE_VERSION --no-restore -o ./nupkg | ||
|
||
PACKAGE_PATH="./nupkg/Paralax.CQRS.EventSourcing.$PACKAGE_VERSION.nupkg" | ||
|
||
if [ -f "$PACKAGE_PATH" ]; then | ||
echo "Checking if the package is already signed..." | ||
if dotnet nuget verify "$PACKAGE_PATH" | grep -q 'Package is signed'; then | ||
echo "Package is already signed, skipping signing." | ||
else | ||
echo "Signing the NuGet package..." | ||
dotnet nuget sign "$PACKAGE_PATH" \ | ||
--certificate-path "$CERTIFICATE_PATH" \ | ||
--timestamper http://timestamp.digicert.com | ||
fi | ||
|
||
echo "Uploading Paralax.CQRS.EventSourcing package to NuGet..." | ||
dotnet nuget push "$PACKAGE_PATH" -k "$NUGET_API_KEY" \ | ||
-s https://api.nuget.org/v3/index.json --skip-duplicate | ||
echo "Package uploaded to NuGet." | ||
else | ||
echo "Error: Package $PACKAGE_PATH not found." | ||
exit 1 | ||
fi |
18 changes: 18 additions & 0 deletions
18
src/Paralax.CQRS.EventSourcing/scripts/test-and-collect-coverage.sh
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
echo "Running tests and collecting coverage for Paralax.Security..." | ||
|
||
cd src/Paralax.Security/src | ||
|
||
echo "Restoring NuGet packages..." | ||
dotnet restore | ||
|
||
echo "Running tests and generating code coverage report..." | ||
dotnet test --collect:"XPlat Code Coverage" --results-directory ./TestResults | ||
|
||
# Check if tests succeeded | ||
if [ $? -ne 0 ]; then | ||
echo "Tests failed. Exiting..." | ||
exit 1 | ||
fi | ||
|