1- name : Release
1+ name : Release CLI
22
33on :
44 push :
55 branches :
6- - release/*
6+ - release/cli- *
77
88jobs :
9- build_test_package :
9+ build_test_package_release :
1010 name : Build, test, package and release
1111 strategy :
1212 matrix :
@@ -39,14 +39,14 @@ jobs:
3939 echo "::set-output name=module::$module"
4040 echo "::set-output name=version::$version"
4141
42- # - name: Check release module and version
43- # shell: pwsh
44- # run: |
45- # # echo "env: $env:RELEASE_MODULE"
46- # # echo "env: $env:RELEASE_VERSION"
42+ - name : Check release module and version
43+ shell : pwsh
44+ run : |
45+ # echo "env: $env:RELEASE_MODULE"
46+ # echo "env: $env:RELEASE_VERSION"
4747
48- # echo "output: ${{ steps.release.outputs.module }}"
49- # echo "output: ${{ steps.release.outputs.version }}"
48+ echo "output: ${{ steps.release.outputs.module }}"
49+ echo "output: ${{ steps.release.outputs.version }}"
5050
5151 - name : Checkout the repository
5252 uses : actions/checkout@v2
@@ -57,91 +57,52 @@ jobs:
5757 # node-version: ${{ matrix.node }}
5858
5959 - name : Setup .NET SDK
60+ if : steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
6061 uses : actions/setup-dotnet@v1
6162 with :
6263 dotnet-version : ${{ matrix.dotnet }}
6364
6465 - name : Add MSBuild to PATH
66+ if : steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
65676668
6769 - name : Restore NuGet packages
70+ if : steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
6871 shell : pwsh
6972 run : |
7073 dir
7174 dotnet restore .
7275
7376 - name : Build solution
77+ if : steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
7478 shell : pwsh
7579 run : |
7680 dir
7781 msbuild . /p:Configuration=Release /p:Version=${{ steps.release.outputs.version }} /p:Verbosity=minimal
7882
7983 - name : Test solution
84+ if : steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
8085 shell : pwsh
8186 run : |
8287 dir
8388 dotnet test . -c Release
8489
8590 - name : Publish CLI for .NET Framework
86- if : matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64'
91+ if : steps.release.outputs.module == 'cli' && matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64'
8792 shell : pwsh
8893 run : |
8994 dir
90- dotnet publish ./src/Aliencube.AzureFunctions.Extensions.OpenApi.CLI -c Release -f ${{ matrix.targetFramework }} -r ${{ maxtrix .runtime }}
95+ dotnet publish ./src/Aliencube.AzureFunctions.Extensions.OpenApi.CLI -c Release -f ${{ matrix.targetFramework }} -r ${{ matrix .runtime }}
9196
9297 - name : Publish CLI for .NET Core
93- if : matrix.targetFramework == 'netcoreapp3.1'
98+ if : steps.release.outputs.module == 'cli' && matrix.targetFramework == 'netcoreapp3.1'
9499 shell : pwsh
95100 run : |
96101 dir
97- dotnet publish ./src/Aliencube.AzureFunctions.Extensions.OpenApi.CLI -c Release -f ${{ matrix.targetFramework }} -p:PublishSingleFile=true --self-contained true -r ${{ maxtrix.runtime }}
98-
99- - name : List Package for AppSettings
100- if : steps.release.outputs.module == 'appsettings'
101- shell : pwsh
102- run : |
103- $package = Get-ChildItem -Path ./src/*.AppSettings -Include *.nupkg -Recurse | Where-Object { $_.FullName -like "*${{ steps.release.outputs.version }}*" }
104- $path = $package[0].FullName
105- $name = $package[0].Name
106-
107- echo "::set-env name=PACKAGE_PATH::$path"
108- echo "::set-env name=PACKAGE_NAME::$name"
109-
110- - name : List Package for Configuration.Json
111- if : steps.release.outputs.module == 'configjson'
112- shell : pwsh
113- run : |
114- $package = Get-ChildItem -Path ./src/*.Json -Include *.nupkg -Recurse | Where-Object { $_.FullName -like "*${{ steps.release.outputs.version }}*" }
115- $path = $package[0].FullName
116- $name = $package[0].Name
117-
118- echo "::set-env name=PACKAGE_PATH::$path"
119- echo "::set-env name=PACKAGE_NAME::$name"
120-
121- - name : List Package for DependencyInjection
122- if : steps.release.outputs.module == 'di'
123- shell : pwsh
124- run : |
125- $package = Get-ChildItem -Path ./src/*.DependencyInjection -Include *.nupkg -Recurse | Where-Object { $_.FullName -like "*${{ steps.release.outputs.version }}*" }
126- $path = $package[0].FullName
127- $name = $package[0].Name
128-
129- echo "::set-env name=PACKAGE_PATH::$path"
130- echo "::set-env name=PACKAGE_NAME::$name"
131-
132- - name : List Package for OpenApi
133- if : steps.release.outputs.module == 'swagger'
134- shell : pwsh
135- run : |
136- $package = Get-ChildItem -Path ./src/*.OpenApi -Include *.nupkg -Recurse | Where-Object { $_.FullName -like "*${{ steps.release.outputs.version }}*" }
137- $path = $package[0].FullName
138- $name = $package[0].Name
139-
140- echo "::set-env name=PACKAGE_PATH::$path"
141- echo "::set-env name=PACKAGE_NAME::$name"
102+ dotnet publish ./src/Aliencube.AzureFunctions.Extensions.OpenApi.CLI -c Release -f ${{ matrix.targetFramework }} -p:PublishSingleFile=true --self-contained true -r ${{ matrix.runtime }}
142103
143104 - name : List Package for OpenApi.CLI
144- if : steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime = 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
105+ if : steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
145106 shell : pwsh
146107 run : |
147108 $sourcepath = "./src/*.OpenApi.CLI/bin/Release/${{ matrix.targetFramework }}/${{ matrix.runtime }}/publish"
@@ -154,12 +115,14 @@ jobs:
154115 echo "::set-env name=PACKAGE_NAME::$name"
155116
156117 - name : Check release module and version
118+ if : steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
157119 shell : pwsh
158120 run : |
159121 echo "package-path: $env:PACKAGE_PATH"
160122 echo "package-name: $env:PACKAGE_NAME"
161123
162124 # - name: Create Release to GitHub
125+ # if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
163126 # id: release
164127 # uses: actions/create-release@v1
165128 # env:
@@ -170,19 +133,8 @@ jobs:
170133 # draft: false
171134 # prerelease: false
172135
173- # - name: Upload NuGet package to GitHub
174- # if: steps.release.outputs.module != 'cli'
175- # uses: actions/upload-release-asset@v1
176- # env:
177- # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
178- # with:
179- # upload_url: ${{ steps.release.outputs.upload_url }}
180- # asset_path: ${{ $PACKAGE_PATH }}
181- # asset_name: ${{ $PACKAGE_NAME }}
182- # asset_content_type: application/octet-stream
183-
184136 # - name: Upload CLI to GitHub
185- # if: steps.release.outputs.module == 'cli'
137+ # if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
186138 # uses: actions/upload-release-asset@v1
187139 # env:
188140 # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -192,14 +144,8 @@ jobs:
192144 # asset_name: ${{ $PACKAGE_NAME }}
193145 # asset_content_type: application/zip
194146
195- # - name: Release to NuGet
196- # if: steps.release.outputs.module != 'cli'
197- # shell: pwsh
198- # run: |
199- # dotnet nuget push $env:PACKAGE_PATH --source https://api.nuget.org/v3/index.json --apk-key ${{ secrets.NUGET_API_KEY }}
200-
201147 # - name: Release to npm
202- # if: steps.release.outputs.module == 'cli'
148+ # if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
203149 # uses: JS-DevTools/npm-publish@v1
204150 # with:
205151 # token: ${{ secrets.NPM_TOKEN }}
0 commit comments