From 581d19f8316a9b6ccc995b961748e537a6fc041c Mon Sep 17 00:00:00 2001 From: Andrzej Bakun Date: Sun, 14 Apr 2024 20:03:54 +0200 Subject: [PATCH] chapter-3 nuget.config setup in CI --- .../chapter-3-contracts-workflow.yml | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/.github/workflows/chapter-3-contracts-workflow.yml b/.github/workflows/chapter-3-contracts-workflow.yml index 6320a225..e3701af1 100644 --- a/.github/workflows/chapter-3-contracts-workflow.yml +++ b/.github/workflows/chapter-3-contracts-workflow.yml @@ -1,24 +1,24 @@ name: Chapter 3 Contracts on: push: - branches: [ "main" ] + branches: ["main"] paths: - - 'Chapter-3-microservice-extraction/Fitnet.Contracts/Src/**' + - "Chapter-3-microservice-extraction/Fitnet.Contracts/Src/**" pull_request: - branches: [ "main" ] + branches: ["main"] paths: - - 'Chapter-3-microservice-extraction/Fitnet.Contracts/Src/**' + - "Chapter-3-microservice-extraction/Fitnet.Contracts/Src/**" env: - CHAPTER_DIR: 'Chapter-3-microservice-extraction/Fitnet.Contracts/Src' + CHAPTER_DIR: "Chapter-3-microservice-extraction/Fitnet.Contracts/Src" -jobs: +jobs: build: defaults: run: working-directory: ${{ env.CHAPTER_DIR }} runs-on: ubuntu-latest - + name: Build steps: - uses: actions/checkout@v3 @@ -26,18 +26,17 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: 8.0.x - - name: Add GitHub NuGet Source - run: | - dotnet nuget add source --username $OWNER --password $GITHUB_TOKEN --store-password-in-clear-text --name github "https://nuget.pkg.github.com/$OWNER/index.json" - dotnet nuget list source - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OWNER: ${{ github.repository_owner }} + - name: Add Evolutionary Architecture Nuget Source + uses: anddrzejb/evolutionary-architecture-by-example/.github@feature/add-github-nuget-feed-as-part-of-solution + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + owner: ${{ github.repository_owner }} + path: ${{ env.CHAPTER_DIR }} - name: Restore dependencies run: dotnet restore - name: Build run: dotnet build --no-restore - + test: defaults: run: @@ -51,14 +50,13 @@ jobs: uses: actions/setup-dotnet@v3 with: dotnet-version: 8.0.x - - name: Add GitHub NuGet Source - run: | - dotnet nuget add source --username $OWNER --password $GITHUB_TOKEN --store-password-in-clear-text --name github "https://nuget.pkg.github.com/$OWNER/index.json" - dotnet nuget list source - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - OWNER: ${{ github.repository_owner }} + - name: Add Evolutionary Architecture Nuget Source + uses: evolutionary-architecture/evolutionary-architecture-by-example/.github@feature/nuget_config + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + owner: ${{ github.repository_owner }} + path: ${{ env.CHAPTER_DIR }} - name: Restore dependencies run: dotnet restore - name: Test - run: dotnet test + run: dotnet test \ No newline at end of file