|
1 | | -name: NuGet Push to Production - ESDM Nexus and nuget.org |
2 | | - |
3 | | -on: |
4 | | - workflow_dispatch: |
5 | | - |
6 | | -jobs: |
7 | | - push-nuget: |
8 | | - runs-on: ubuntu-latest |
9 | | - steps: |
10 | | - - uses: actions/checkout@v4 |
11 | | - - name: Setup .NET |
12 | | - uses: actions/setup-dotnet@v4 |
13 | | - with: |
14 | | - dotnet-version: 8.0.x |
15 | | - - name: Exit if the branch is not master |
16 | | - run: | |
17 | | - if [[ "${{ github.ref }}" != "refs/heads/master" ]]; then |
18 | | - echo "Branch is not master, exiting." |
19 | | - exit 1 |
20 | | - fi |
21 | | - - name: Setup NuGet |
22 | | - run: dotnet nuget add source ${{ secrets.NUGET_SOURCE_URL }} -u ${{ secrets.NUGET_USERNAME }} -p ${{ secrets.NUGET_PASSWORD }} --store-password-in-clear-text --name esdm-nuget-testing |
23 | | - - name: Restore dependencies |
24 | | - run: dotnet restore |
25 | | - - name: Build |
26 | | - run: dotnet build -c Release |
27 | | - - name: Create NuGet package |
28 | | - run: dotnet pack -c Release |
29 | | - - name: Auth to other Nexus repo |
30 | | - 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-nuget-hosted |
31 | | - - name: Find and Push NuGet packages to Nexus |
32 | | - run: | |
33 | | - PACKAGES=$(find . -name "*.nupkg" | grep -E "cloudscribe|sts\.") |
34 | | - if [ -z "$PACKAGES" ]; then |
35 | | - echo "No matching package found. Exiting." |
36 | | - exit 1 |
37 | | - fi |
38 | | - echo "Found packages: $PACKAGES" |
39 | | - for PACKAGE in $PACKAGES; do |
40 | | - echo "Pushing $PACKAGE to Nexus" |
41 | | - dotnet nuget push "$PACKAGE" --source esdm-nuget-hosted --skip-duplicate || echo "WARNING - skipping duplicate package: $PACKAGE" |
42 | | - done |
43 | | - - name: Find and Push NuGet packages to nuget.org |
44 | | - env: |
45 | | - NUGET_ORG_API_KEY: ${{ secrets.NUGET_ORG_API_KEY }} |
46 | | - run: | |
47 | | - PACKAGES=$(find . -name "*.nupkg" | grep -E "cloudscribe|sts\.Common") |
48 | | - if [ -z "$PACKAGES" ]; then |
49 | | - echo "No matching package found. Exiting." |
50 | | - exit 1 |
51 | | - fi |
52 | | - echo "Found packages: $PACKAGES" |
53 | | - for PACKAGE in $PACKAGES; do |
54 | | - echo "Pushing $PACKAGE to nuget.org" |
55 | | - dotnet nuget push "$PACKAGE" --api-key "$NUGET_ORG_API_KEY" --source "https://api.nuget.org/v3/index.json" --skip-duplicate || { echo "WARNING - failed to upload package: $PACKAGE"; exit 1; } |
56 | | - done |
| 1 | +name: NuGet Push to Production - ESDM Nexus and nuget.org |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + |
| 6 | +jobs: |
| 7 | + push-nuget: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - uses: actions/checkout@v4 |
| 11 | + - name: Setup .NET |
| 12 | + uses: actions/setup-dotnet@v4 |
| 13 | + with: |
| 14 | + dotnet-version: 8.0.x |
| 15 | + - name: Exit if the branch is not master |
| 16 | + run: | |
| 17 | + if [[ "${{ github.ref }}" != "refs/heads/master" ]]; then |
| 18 | + echo "Branch is not master, exiting." |
| 19 | + exit 1 |
| 20 | + fi |
| 21 | + - name: Setup NuGet |
| 22 | + run: dotnet nuget add source ${{ secrets.NUGET_SOURCE_URL }} -u ${{ secrets.NUGET_USERNAME }} -p ${{ secrets.NUGET_PASSWORD }} --store-password-in-clear-text --name esdm-nuget-testing |
| 23 | + - name: Restore dependencies |
| 24 | + run: dotnet restore |
| 25 | + - name: Build |
| 26 | + run: dotnet build -c Release |
| 27 | + - name: Create NuGet package |
| 28 | + run: dotnet pack -c Release |
| 29 | + - name: Auth to other Nexus repo |
| 30 | + 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-nuget-hosted |
| 31 | + - name: Find and Push NuGet packages to Nexus |
| 32 | + run: | |
| 33 | + PACKAGES=$(find . -name "*.nupkg" | grep -E "cloudscribe|sts\.") |
| 34 | + if [ -z "$PACKAGES" ]; then |
| 35 | + echo "No matching package found. Exiting." |
| 36 | + exit 1 |
| 37 | + fi |
| 38 | + echo "Found packages: $PACKAGES" |
| 39 | + for PACKAGE in $PACKAGES; do |
| 40 | + echo "Pushing $PACKAGE to Nexus" |
| 41 | + dotnet nuget push "$PACKAGE" --source esdm-nuget-hosted --skip-duplicate || echo "WARNING - skipping duplicate package: $PACKAGE" |
| 42 | + done |
| 43 | + - name: Find and Push NuGet packages to nuget.org |
| 44 | + env: |
| 45 | + NUGET_ORG_API_KEY: ${{ secrets.NUGET_ORG_API_KEY }} |
| 46 | + run: | |
| 47 | + PACKAGES=$(find . -name "*.nupkg" | grep -E "cloudscribe|sts\.Common") |
| 48 | + if [ -z "$PACKAGES" ]; then |
| 49 | + echo "No matching package found. Exiting." |
| 50 | + exit 1 |
| 51 | + fi |
| 52 | + echo "Found packages: $PACKAGES" |
| 53 | + for PACKAGE in $PACKAGES; do |
| 54 | + echo "Pushing $PACKAGE to nuget.org" |
| 55 | + dotnet nuget push "$PACKAGE" --api-key "$NUGET_ORG_API_KEY" --source "https://api.nuget.org/v3/index.json" --skip-duplicate || { echo "WARNING - failed to upload package: $PACKAGE"; exit 1; } |
| 56 | + done |
0 commit comments