Manual NuGet Push to ESDM Nexus #14
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
| name: Manual NuGet Push to ESDM Nexus | |
| on: | |
| workflow_dispatch: | |
| branches: [ "develop" ] | |
| jobs: | |
| push-nuget: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| run: dotnet build -c Release | |
| - name: Create NuGet package | |
| run: dotnet pack -c Release | |
| - name: Auth to other Nexus repo | |
| run: dotnet nuget add source ${{ secrets.ESDM_NUGET_HOSTED_URL }} -u ${{ secrets.NUGET_USERNAME }} -p ${{ secrets.NUGET_PASSWORD }} --store-password-in-clear-text --name esdm-nexus-target | |
| - name: Find and Push NuGet packages | |
| run: | | |
| PACKAGES=$(find . -name "*.nupkg" | grep -E "cloudscribe|sts\.Common") | |
| if [ -z "$PACKAGES" ]; then | |
| echo "No matching package found. Exiting." | |
| exit 1 | |
| fi | |
| echo "Found packages: $PACKAGES" | |
| for PACKAGE in $PACKAGES; do | |
| echo "Pushing $PACKAGE" | |
| dotnet nuget push "$PACKAGE" --source esdm-nexus-target --skip-duplicate | |
| done |