From 620e5a1e43dd9e2fdb17c9742dac2281a16a5ba7 Mon Sep 17 00:00:00 2001 From: Johannes Tuerk Date: Wed, 13 Dec 2023 20:24:26 +0100 Subject: [PATCH] pipeline Signed-off-by: Johannes Tuerk --- .github/workflows/publish-nuget.yaml | 95 +++++++++---------- ...erledger.Aries.AspNetCore.Contracts.csproj | 1 + .../Hyperledger.Aries.AspNetCore.csproj | 1 + .../Hyperledger.Aries.Routing.Edge.csproj | 1 + .../Hyperledger.Aries.Routing.Mediator.csproj | 1 + .../Hyperledger.Aries.Routing.csproj | 1 + .../Hyperledger.Aries.csproj | 1 + 7 files changed, 52 insertions(+), 49 deletions(-) diff --git a/.github/workflows/publish-nuget.yaml b/.github/workflows/publish-nuget.yaml index a996a1a4..d38993c0 100644 --- a/.github/workflows/publish-nuget.yaml +++ b/.github/workflows/publish-nuget.yaml @@ -3,64 +3,61 @@ name: CI on: push: branches: - - setup-cicd-pipeline + - setup-cicd-pipeline pull_request: branches: - - setup-cicd-pipeline + - setup-cicd-pipeline - env: - MAJOR: 0 - MINOR: 1 - PATCH: 0 - APP_VERSION: v$(MAJOR).$(MINOR).$(PATCH) BUILD_CONFIG: 'Release' SOLUTION: 'src/Hyperledger.Aries.sln' - #IS_PULL_REQUEST: ${{ github.ref == 'refs/pull/.../merge' }} + IS_PULL_REQUEST: ${{ github.event_name == 'pull_request' }} IS_MAIN_BRANCH: ${{ github.ref == 'refs/heads/main' }} - IS_DEV_BRANCH: ${{ github.ref == 'refs/heads/develop' }} - IS_RELEASE_BRANCH: ${{ github.ref == 'refs/heads/release' }} - -jobs: + MAJOR: '0' + MINOR: '1' + PATCH: '0' -# build_number: -# name: Set Build Number -# -# runs-on: ubuntu-latest -# -# steps: -# - name: Check bats version -# run: bats --version - +jobs: build: - name: Build - needs: build_number - + runs-on: ubuntu-latest - + steps: - - uses: actions/checkout@v3 - - - name: Setup NuGet - uses: NuGet/setup-nuget@v1 + - uses: actions/checkout@v2 + + - name: Set Version + run: | + if $IS_MAIN_BRANCH; then + SUFFIX="rc" + elif $IS_PULL_REQUEST; then + SUFFIX="alpha" + fi + echo "APP_VERSION=$MAJOR.$MINOR.$PATCH-$SUFFIX.${{ github.run_number }}" >> $GITHUB_ENV + + - name: Version + run: echo $APP_VERSION + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1.0.5 - - name: Configure NuGet sources - run: | - nuget sources add -name SD-JWT -source https://pkgs.dev.azure.com/mi-lissi/OID4VC/_packaging/lissi-oid4vc/nuget/v3/index.json - - - name: Restore dependencies - run: nuget restore $SOLUTION - - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 3.1.x - - - name: Build - run: dotnet build $SOLUTION --configuration $BUILD_CONFIG --no-restore - - #- name: Run tests - #run: dotnet test /p:Configuration=$env:BUILD_CONFIG --no-restore --no-build --verbosity normal - - #- name: Publish - #run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} + - name: Restore dependencies + run: nuget restore $SOLUTION + + - name: Setup .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 3.1.* + + - name: Build + run: dotnet build $SOLUTION --configuration $BUILD_CONFIG -p:Version=$APP_VERSION --no-restore + + - name: Run tests + run: dotnet test /p:Configuration=$BUILD_CONFIG --no-restore --no-build --verbosity normal + + - name: Pack WalletFramework.Core + run: dotnet pack /p:Configuration=$BUILD_CONFIG /p:Version=$APP_VERSION --no-build --output . +# +# - name: Publish +# run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} + + diff --git a/src/Hyperledger.Aries.AspNetCore.Contracts/Hyperledger.Aries.AspNetCore.Contracts.csproj b/src/Hyperledger.Aries.AspNetCore.Contracts/Hyperledger.Aries.AspNetCore.Contracts.csproj index cb50fec1..9ce251b2 100644 --- a/src/Hyperledger.Aries.AspNetCore.Contracts/Hyperledger.Aries.AspNetCore.Contracts.csproj +++ b/src/Hyperledger.Aries.AspNetCore.Contracts/Hyperledger.Aries.AspNetCore.Contracts.csproj @@ -1,6 +1,7 @@  Api Library + WalletFramework.AspNetCore.Contracts enable diff --git a/src/Hyperledger.Aries.AspNetCore/Hyperledger.Aries.AspNetCore.csproj b/src/Hyperledger.Aries.AspNetCore/Hyperledger.Aries.AspNetCore.csproj index bfe2373e..7c95f345 100644 --- a/src/Hyperledger.Aries.AspNetCore/Hyperledger.Aries.AspNetCore.csproj +++ b/src/Hyperledger.Aries.AspNetCore/Hyperledger.Aries.AspNetCore.csproj @@ -4,6 +4,7 @@ true $(NoWarn);1591 ASP.NET Core support for Agent Framework + WalletFramework.AspNetCore $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb diff --git a/src/Hyperledger.Aries.Routing.Edge/Hyperledger.Aries.Routing.Edge.csproj b/src/Hyperledger.Aries.Routing.Edge/Hyperledger.Aries.Routing.Edge.csproj index 1cd1feb6..41c63b3f 100644 --- a/src/Hyperledger.Aries.Routing.Edge/Hyperledger.Aries.Routing.Edge.csproj +++ b/src/Hyperledger.Aries.Routing.Edge/Hyperledger.Aries.Routing.Edge.csproj @@ -1,5 +1,6 @@ + WalletFramework.Routing.Edge bin\$(Configuration)\$(TargetFramework)\Hyperledger.Aries.Routing.Edge.xml diff --git a/src/Hyperledger.Aries.Routing.Mediator/Hyperledger.Aries.Routing.Mediator.csproj b/src/Hyperledger.Aries.Routing.Mediator/Hyperledger.Aries.Routing.Mediator.csproj index 559ba6a4..4c3a6bfe 100644 --- a/src/Hyperledger.Aries.Routing.Mediator/Hyperledger.Aries.Routing.Mediator.csproj +++ b/src/Hyperledger.Aries.Routing.Mediator/Hyperledger.Aries.Routing.Mediator.csproj @@ -1,6 +1,7 @@ + WalletFramework.Routing.Mediator bin\$(Configuration)\$(TargetFramework)\Hyperledger.Aries.Routing.Mediator.xml diff --git a/src/Hyperledger.Aries.Routing/Hyperledger.Aries.Routing.csproj b/src/Hyperledger.Aries.Routing/Hyperledger.Aries.Routing.csproj index f510ffa2..ff816e34 100644 --- a/src/Hyperledger.Aries.Routing/Hyperledger.Aries.Routing.csproj +++ b/src/Hyperledger.Aries.Routing/Hyperledger.Aries.Routing.csproj @@ -1,5 +1,6 @@ + WalletFramework.Routing bin\$(Configuration)\$(TargetFramework)\Hyperledger.Aries.Routing.xml diff --git a/src/Hyperledger.Aries/Hyperledger.Aries.csproj b/src/Hyperledger.Aries/Hyperledger.Aries.csproj index 7cd0cbb5..55b44006 100644 --- a/src/Hyperledger.Aries/Hyperledger.Aries.csproj +++ b/src/Hyperledger.Aries/Hyperledger.Aries.csproj @@ -1,6 +1,7 @@ .NET Core tools for building agent services + WalletFramework bin\$(Configuration)\$(TargetFramework)\Hyperledger.Aries.xml $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb enable