diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e9ff3649..f9aa5249 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -44,3 +44,43 @@ jobs: - name: Run Tests run: dotnet test test\OpenFeature.Tests\ --configuration Release --logger GitHubActions + + packaging: + needs: + - unit-tests-linux + - unit-tests-windows + + permissions: + contents: read + packages: write + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 6.0.x + 7.0.x + + - name: Restore + run: dotnet restore + + - name: Pack NuGet packages (CI versions) + if: startsWith(github.ref, 'refs/heads/') + run: dotnet pack --no-restore --version-suffix "ci.$(date -u +%Y%m%dT%H%M%S)+sha.${GITHUB_SHA:0:9}" + + - name: Pack NuGet packages (PR versions) + if: startsWith(github.ref, 'refs/pull/') + run: dotnet pack --no-restore --version-suffix "pr.$(date -u +%Y%m%dT%H%M%S)+sha.${GITHUB_SHA:0:9}" + + - name: Pack NuGet packages (Release versions) + if: startsWith(github.ref, 'refs/tags/v') + run: dotnet pack --no-restore + + - name: Publish NuGet packages + if: startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/pull/') || startsWith(github.ref, 'refs/tags/v') + run: dotnet nuget push "src/**/*.nupkg" --api-key "${{ secrets.GITHUB_TOKEN }}" --source https://nuget.pkg.github.com/open-feature/index.json diff --git a/build/Common.prod.props b/build/Common.prod.props index 49e454c5..8fbce04c 100644 --- a/build/Common.prod.props +++ b/build/Common.prod.props @@ -2,7 +2,10 @@ + true + true true + true diff --git a/build/Common.props b/build/Common.props index 65bf984d..e83b31ad 100644 --- a/build/Common.props +++ b/build/Common.props @@ -27,4 +27,8 @@ + + + +