-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dde6122
commit f0b66c7
Showing
1 changed file
with
40 additions
and
39 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 |
---|---|---|
@@ -1,63 +1,64 @@ | ||
name: Contracts package workflow | ||
|
||
name: Chapter 4 Contracts | ||
on: | ||
push: | ||
branches: [ "main" ] | ||
paths: | ||
- 'Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/**' | ||
- 'Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/**' | ||
pull_request: | ||
branches: [ "main" ] | ||
paths: | ||
- 'Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/Fitnet.Contracts.IntegrationEvents/**' | ||
- 'Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src/**' | ||
|
||
env: | ||
CHAPTER_DIR: 'Chapter-4-applying-tactical-domain-driven-design/Fitnet.Contracts/Src' | ||
|
||
jobs: | ||
jobs: | ||
build: | ||
defaults: | ||
run: | ||
working-directory: ${{ env.CHAPTER_DIR }} | ||
runs-on: ubuntu-latest | ||
|
||
name: Build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.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: Restore dependencies | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build --no-restore | ||
|
||
pack: | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.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: Restore dependencies | ||
run: dotnet restore | ||
- name: Build | ||
run: dotnet build --no-restore | ||
test: | ||
defaults: | ||
run: | ||
working-directory: ${{ env.CHAPTER_DIR }} | ||
runs-on: ubuntu-latest | ||
name: Test | ||
needs: build | ||
if: github.ref == 'refs/heads/main' | ||
name: Pack and Publish | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.0.x | ||
- name: Prepare Packages | ||
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" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
OWNER: ${{ github.repository_owner }} | ||
- name: Pack Project | ||
run: dotnet pack Fitnet.Contracts.IntegrationEvents/Fitnet.Contracts.IntegrationEvents.csproj -c Release | ||
- name: Publish Packages | ||
run: dotnet nuget push "Fitnet.Contracts.IntegrationEvents/bin/Release/EvolutionaryArchitecture.Fitnet.Contracts.IntegrationEvents.*.nupkg" --source "github" --api-key ${{ secrets.GITHUB_TOKEN }} | ||
- uses: actions/checkout@v3 | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 7.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: Restore dependencies | ||
run: dotnet restore | ||
- name: Test | ||
run: dotnet test |