File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : workflow - publish packages
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+ - development
8+ paths :
9+ - Packages/Federation.Sdk/**
10+ - Packages/Federation.Sdk.Contracts/**
11+
12+ pull_request :
13+ branches :
14+ - master
15+ - development
16+
17+ paths :
18+ - Packages/Federation.Sdk/**
19+ - Packages/Federation.Sdk.Contracts/**
20+
21+ jobs :
22+ changes :
23+ runs-on : ubuntu-latest
24+ outputs :
25+ federation_sdk : ${{ steps.filter.outputs.federation_sdk }}
26+ federation_sdk_contracts : ${{ steps.filter.outputs.federation_sdk_contracts }}
27+
28+ steps :
29+ - name : checkout code
30+ uses : actions/checkout@v4
31+
32+ - name : detect changed paths
33+ id : filter
34+ uses : dorny/paths-filter@v3
35+ with :
36+ filters : |
37+ federation_sdk:
38+ - 'Packages/Federation.Sdk/**'
39+ federation_sdk_contracts:
40+ - 'Packages/Federation.Sdk.Contracts/**'
41+
42+ publish-federation-sdk :
43+ needs : changes
44+ if : needs.changes.outputs.federation_sdk == 'true'
45+ uses : ./.github/workflows/reusable-publish-package.yml
46+ with :
47+ working_directory : Packages/Federation.Sdk/Source
48+ dotnet_version : 9.0.x
49+ base_version : " 1.0"
50+ secrets : inherit
51+
52+ publish-federation-sdk-contracts :
53+ needs : changes
54+ if : needs.changes.outputs.federation_sdk_contracts == 'true'
55+ uses : ./.github/workflows/reusable-publish-package.yml
56+ with :
57+ working_directory : Packages/Federation.Sdk.Contracts/Source
58+ dotnet_version : 9.0.x
59+ base_version : " 1.0"
60+ secrets : inherit
Original file line number Diff line number Diff line change 1+ name : workflow - publish package
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ working_directory :
7+ description : project directory to restore/build/pack
8+ required : true
9+ type : string
10+
11+ dotnet_version :
12+ description : .NET SDK version
13+ required : false
14+ type : string
15+ default : 9.0.x
16+
17+ base_version :
18+ description : base semantic version
19+ required : false
20+ type : string
21+ default : " 1.0"
22+
23+ publish_package :
24+ description : if false, runs restore/build/pack without pushing
25+ required : false
26+ type : boolean
27+ default : true
28+ secrets :
29+ NUGET_API_KEY :
30+ required : true
31+
32+ jobs :
33+ publish :
34+ runs-on : ubuntu-latest
35+
36+ defaults :
37+ run :
38+ working-directory : ${{ inputs.working_directory }}
39+
40+ steps :
41+ - name : checkout code
42+ uses : actions/checkout@v4
43+
44+ - name : setup .NET
45+ uses : actions/setup-dotnet@v4
46+ with :
47+ dotnet-version : ${{ inputs.dotnet_version }}
48+
49+ - name : restore dependencies
50+ run : dotnet restore
51+
52+ - name : build
53+ run : dotnet build --configuration Release --no-restore
54+
55+ - name : set version and pack
56+ id : pack
57+ env :
58+ BASE_VERSION : ${{ inputs.base_version }}
59+ run : |
60+ if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then
61+ VERSION="${BASE_VERSION}.${GITHUB_RUN_NUMBER}"
62+ else
63+ VERSION="${BASE_VERSION}-beta.${GITHUB_RUN_NUMBER}"
64+ fi
65+
66+ echo "use version: $VERSION"
67+ dotnet pack -c Release -p:PackageVersion=$VERSION -o ./output --no-build
68+
69+ echo "package_version=$VERSION" >> $GITHUB_OUTPUT
70+
71+ - name : push package to nuget
72+ if : ${{ inputs.publish_package }}
73+ run : dotnet nuget push ./output/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
Original file line number Diff line number Diff line change 1+ name : workflow — quality assurance
2+
3+ on :
4+ workflow_call :
5+ inputs :
6+ service_path :
7+ required : true
8+ type : string
9+
10+ jobs :
11+ quality-assurance :
12+ runs-on : ubuntu-latest
13+
14+ defaults :
15+ run :
16+ working-directory : ${{ inputs.service_path }}
17+
18+ steps :
19+ - name : checkout
20+ uses : actions/checkout@v4
21+
22+ - name : setup dotnet
23+ uses : actions/setup-dotnet@v4
24+ with :
25+ dotnet-version : ' 9.0.x'
26+
27+ - name : restore
28+ run : dotnet restore
29+
30+ - name : build
31+ run : dotnet build --no-restore --configuration Release
32+
33+ - name : test
34+ run : dotnet test --no-build --configuration Release --verbosity normal
You can’t perform that action at this time.
0 commit comments