From dba78101b065b5102b0cef8ed546a3e6389a9328 Mon Sep 17 00:00:00 2001 From: Francis Pion Date: Mon, 23 Dec 2024 10:42:37 -0500 Subject: [PATCH] Fixed publishing. (#486) --- .github/workflows/backend-build.yaml | 2 -- .../{publish.yaml => publish-docker.yaml} | 22 ++----------- .github/workflows/publish-nuget.yaml | 31 +++++++++++++++++++ 3 files changed, 33 insertions(+), 22 deletions(-) rename .github/workflows/{publish.yaml => publish-docker.yaml} (59%) create mode 100644 .github/workflows/publish-nuget.yaml diff --git a/.github/workflows/backend-build.yaml b/.github/workflows/backend-build.yaml index 66e199790..ac34ace0d 100644 --- a/.github/workflows/backend-build.yaml +++ b/.github/workflows/backend-build.yaml @@ -4,13 +4,11 @@ on: push: branches: - main - - v5 paths: - 'backend/**' pull_request: branches: - main - - v5 paths: - 'backend/**' workflow_dispatch: diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish-docker.yaml similarity index 59% rename from .github/workflows/publish.yaml rename to .github/workflows/publish-docker.yaml index 28db11511..2cc13a016 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish-docker.yaml @@ -1,5 +1,4 @@ -name: Publish Docker Image to Docker Hub & NuGet Packages - +name: Publish Docker Image to Docker Hub on: release: types: [published] @@ -7,26 +6,12 @@ on: jobs: publish: - name: Publish Docker Image to Docker Hub & NuGet Packages + name: Publish Docker Image to Docker Hub runs-on: ubuntu-latest steps: - name: Checkout Repository uses: actions/checkout@v4 - - name: Setup .NET9 - uses: actions/setup-dotnet@v4 - with: - dotnet-version: 9.x - - - name: Restore dependencies - run: dotnet restore - - - name: Build Solution - run: dotnet build --configuration Release --no-restore - - - name: Test - run: dotnet test --configuration Release --no-build --verbosity normal --filter Category=Unit - - name: Build Portal Frontend run: | cd ./frontend @@ -54,6 +39,3 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - - name: Push NuGet - run: dotnet nuget push "**/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate --source https://api.nuget.org/v3/index.json diff --git a/.github/workflows/publish-nuget.yaml b/.github/workflows/publish-nuget.yaml new file mode 100644 index 000000000..2b348e2fd --- /dev/null +++ b/.github/workflows/publish-nuget.yaml @@ -0,0 +1,31 @@ +name: Publish NuGet Packages + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + publish: + name: Publish NuGet Packages + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup .NET9 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 9.x + + - name: Restore dependencies + run: dotnet restore + + - name: Build Solution + run: dotnet build --configuration Release --no-restore + + - name: Test + run: dotnet test --configuration Release --no-build --verbosity normal --filter Category=Unit + + - name: Push NuGet + run: dotnet nuget push "**/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --skip-duplicate --source https://api.nuget.org/v3/index.json