diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4778c8e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: dotnet package + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + env: + # set value + SHOULD_DEPLOY: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} + strategy: + matrix: + dotnet-version: ["3.1.x", "6.0.x", "7.0.x"] + steps: + - uses: actions/checkout@v4 + - name: Setup dotnet ${{ matrix.dotnet-version }} + uses: actions/setup-dotnet@v3 + with: + dotnet-version: ${{ matrix.dotnet-version }} + + - name: Restore + run: dotnet restore GrowthBook/GrowthBook.csproj + + - name: Build + run: dotnet build GrowthBook/GrowthBook.csproj --configuration Release + + # current tests are written for visual studio only + # - name: Test + # run: dotnet test Test/Growthook.Tests.csproj --configuration Release --no-build + + - name: pack + run: dotnet pack --configuration Release --no-build --output dist GrowthBook/GrowthBook.csproj + + # # Deploy if SHOULD_DEPLOY is set to true + # - name: publish + # if: ${{ env.SHOULD_DEPLOY }} + # run: dotnet nuget push dist/*.nupkg --api-key $NUGET_KEY --source $NUGET_SOURCE + # env: + # NUGET_KEY: ${{ secrets.NUGET_KEY }} + # NUGET_SOURCE: ${{ secrets.NUGET_SOURCE }} diff --git a/Test/Growthbook.Tests.csproj b/Test/GrowthBook.Tests.csproj similarity index 100% rename from Test/Growthbook.Tests.csproj rename to Test/GrowthBook.Tests.csproj