forked from open-feature/dotnet-sdk-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add support for GitHub Packages (open-feature#134)
Signed-off-by: Austin Drenski <[email protected]>
- Loading branch information
1 parent
23d657f
commit 0def0da
Showing
16 changed files
with
189 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths-ignore: | ||
- '**.md' | ||
pull_request: | ||
branches: [ main ] | ||
paths-ignore: | ||
- '**.md' | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest ] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v4 | ||
env: | ||
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
dotnet-version: | | ||
6.0.x | ||
7.0.x | ||
source-url: https://nuget.pkg.github.com/open-feature/index.json | ||
|
||
- name: Restore | ||
run: dotnet restore | ||
|
||
- name: Build | ||
run: dotnet build --no-restore | ||
|
||
- name: Test | ||
run: dotnet test --no-build --logger GitHubActions | ||
|
||
packaging: | ||
needs: build | ||
|
||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: recursive | ||
|
||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v4 | ||
env: | ||
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
dotnet-version: | | ||
6.0.x | ||
7.0.x | ||
source-url: https://nuget.pkg.github.com/open-feature/index.json | ||
|
||
- 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: Publish NuGet packages (base) | ||
if: github.event.pull_request.head.repo.fork == false | ||
run: dotnet nuget push "src/**/*.nupkg" --api-key "${{ secrets.GITHUB_TOKEN }}" --source https://nuget.pkg.github.com/open-feature/index.json | ||
|
||
- name: Publish NuGet packages (fork) | ||
if: github.event.pull_request.head.repo.fork == true | ||
uses: actions/[email protected] | ||
with: | ||
name: nupkgs | ||
path: src/**/*.nupkg |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"sdk": { | ||
"rollForward": "latestFeature", | ||
"version": "8.0.100" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<configuration> | ||
|
||
<packageSources> | ||
<add key="nuget" value="https://api.nuget.org/v3/index.json" /> | ||
<add key="github-open-feature" value="https://nuget.pkg.github.com/open-feature/index.json" /> | ||
</packageSources> | ||
|
||
<packageSourceMapping> | ||
<packageSource key="nuget"> | ||
<package pattern="OpenFeature" /> | ||
<package pattern="OpenFeature.*" /> | ||
<package pattern="*" /> | ||
</packageSource> | ||
<packageSource key="github-open-feature"> | ||
<package pattern="OpenFeature" /> | ||
<package pattern="OpenFeature.*" /> | ||
</packageSource> | ||
</packageSourceMapping> | ||
|
||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.