Skip to content

Commit 924e34e

Browse files
authored
Release CLI 0.7.0 (#86)
1 parent 1e16c3a commit 924e34e

File tree

2 files changed

+142
-33
lines changed

2 files changed

+142
-33
lines changed

.github/workflows/release-cli.yaml

Lines changed: 133 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ on:
66
- release/cli-*
77

88
jobs:
9-
build_test_package_release:
10-
name: Build, test, package and release
9+
build_test_package:
10+
name: Build, test and package
1111
strategy:
1212
matrix:
1313
os: [ 'windows-latest' ]
@@ -20,6 +20,7 @@ jobs:
2020

2121
steps:
2222
# - name: Check event payload
23+
# if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
2324
# shell: pwsh
2425
# run: |
2526
# echo ${{ toJSON(github.event) }}
@@ -40,6 +41,7 @@ jobs:
4041
echo "::set-output name=version::$version"
4142
4243
- name: Check release module and version
44+
if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
4345
shell: pwsh
4446
run: |
4547
# echo "env: $env:RELEASE_MODULE"
@@ -49,9 +51,11 @@ jobs:
4951
echo "output: ${{ steps.release.outputs.version }}"
5052
5153
- name: Checkout the repository
54+
if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
5255
uses: actions/checkout@v2
5356

5457
# - name: Setup node.js
58+
# if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
5559
# uses: actions/setup-node@v1
5660
# with:
5761
# node-version: ${{ matrix.node }}
@@ -99,53 +103,155 @@ jobs:
99103
shell: pwsh
100104
run: |
101105
dir
102-
dotnet publish ./src/Aliencube.AzureFunctions.Extensions.OpenApi.CLI -c Release -f ${{ matrix.targetFramework }} -p:PublishSingleFile=true --self-contained true -r ${{ matrix.runtime }}
106+
dotnet publish ./src/Aliencube.AzureFunctions.Extensions.OpenApi.CLI -c Release -f ${{ matrix.targetFramework }} -r ${{ matrix.runtime }} -p:PublishSingleFile=true --self-contained true
103107
104108
- name: List Package for OpenApi.CLI
105109
if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
106110
shell: pwsh
107111
run: |
108112
$sourcepath = "./src/*.OpenApi.CLI/bin/Release/${{ matrix.targetFramework }}/${{ matrix.runtime }}/publish"
109113
$targetpath = "./src/*.OpenApi.CLI/bin/Release/${{ matrix.targetFramework }}/azfuncopenapi-v${{ steps.release.outputs.version }}-${{ matrix.targetFramework }}-${{ matrix.runtime }}.zip"
110-
$package = Get-ChildItem -Path $sourcepath -Include *.* -Recurse | Compress-Archive -DestinationPath $targetpath
114+
$package = Get-ChildItem -Path $sourcepath -Recurse | Compress-Archive -DestinationPath $targetpath
111115
$path = (Get-Item $targetpath).FullName
112116
$name = (Get-Item $targetpath).Name
113117
114118
echo "::set-env name=PACKAGE_PATH::$path"
115119
echo "::set-env name=PACKAGE_NAME::$name"
116120
117-
- name: Check release module and version
121+
- name: Check package path and name
118122
if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
123+
id: package
119124
shell: pwsh
120125
run: |
121126
echo "package-path: $env:PACKAGE_PATH"
122127
echo "package-name: $env:PACKAGE_NAME"
123128
124-
# - name: Create Release to GitHub
125-
# if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
126-
# id: release
127-
# uses: actions/create-release@v1
128-
# env:
129-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130-
# with:
131-
# tag_name: ${{ github.event.ref }}
132-
# release_name: Release ${{ github.event.ref }}
133-
# draft: false
134-
# prerelease: false
129+
echo "::set-output name=path::$env:PACKAGE_PATH"
130+
echo "::set-output name=name::$env:PACKAGE_NAME"
135131
136-
# - name: Upload CLI to GitHub
137-
# if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
138-
# uses: actions/upload-release-asset@v1
139-
# env:
140-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
141-
# with:
142-
# upload_url: ${{ steps.release.outputs.upload_url }}
143-
# asset_path: ${{ $PACKAGE_PATH }}
144-
# asset_name: ${{ $PACKAGE_NAME }}
145-
# asset_content_type: application/zip
132+
- name: Upload artifacts
133+
if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
134+
uses: actions/upload-artifact@v2
135+
with:
136+
name: cli
137+
path: "${{ steps.package.outputs.path }}"
138+
139+
package_release:
140+
name: Release packages
141+
needs: build_test_package
142+
strategy:
143+
matrix:
144+
os: [ 'ubuntu-latest' ]
145+
node: [ 10 ]
146+
dotnet: [ '3.1.301' ]
147+
# targetFramework: [ 'net461', 'netcoreapp3.1' ]
148+
# runtime: [ 'win-x64', 'linux-x64', 'osx-x64' ]
149+
150+
runs-on: ${{ matrix.os }}
151+
152+
steps:
153+
- name: Download artifacts
154+
uses: actions/download-artifact@v2
155+
with:
156+
name: cli
157+
path: artifacts
158+
159+
- name: Get all artifacts
160+
id: package
161+
shell: pwsh
162+
run: |
163+
dir ./artifacts
164+
165+
$packages = Get-ChildItem -Path ./artifacts
166+
167+
$package0 = $packages[0].Name
168+
$package1 = $packages[1].Name
169+
$package2 = $packages[2].Name
170+
$package3 = $packages[3].Name
171+
172+
$version = $packages[0].Name.Split('-')[1].Replace("v", "")
173+
174+
echo "version: $version"
175+
echo "package0: $package0"
176+
echo "package1: $package1"
177+
echo "package2: $package2"
178+
echo "package3: $package3"
179+
180+
echo "::set-output name=version::$version"
181+
echo "::set-output name=package0::$package0"
182+
echo "::set-output name=package1::$package1"
183+
echo "::set-output name=package2::$package2"
184+
echo "::set-output name=package3::$package3"
185+
186+
- name: Repackage CLI for Linux and MacOS
187+
shell: bash
188+
run: |
189+
unzip "./artifacts/${{ steps.package.outputs.package1 }}" -d "./artifacts/linux"
190+
chmod +x ./artifacts/linux/azfuncopenapi
191+
ls -al ./artifacts/linux
192+
rm "./artifacts/${{ steps.package.outputs.package1 }}"
193+
zip -r -j "./artifacts/${{ steps.package.outputs.package1 }}" "./artifacts/linux"
194+
195+
unzip "./artifacts/${{ steps.package.outputs.package2 }}" -d "./artifacts/osx"
196+
chmod +x ./artifacts/osx/azfuncopenapi
197+
ls -al ./artifacts/osx
198+
rm "./artifacts/${{ steps.package.outputs.package2 }}"
199+
zip -r -j "./artifacts/${{ steps.package.outputs.package2 }}" "./artifacts/osx"
200+
201+
ls -al ./artifacts
202+
203+
- name: Create Release to GitHub
204+
id: ghrelease
205+
uses: actions/create-release@v1
206+
env:
207+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
208+
with:
209+
tag_name: "cli-${{ steps.package.outputs.version }}"
210+
release_name: Release "cli-v${{ steps.package.outputs.version }}"
211+
draft: false
212+
prerelease: false
213+
214+
- name: Upload CLI to GitHub - net461 win-x64
215+
uses: actions/upload-release-asset@v1
216+
env:
217+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
218+
with:
219+
upload_url: ${{ steps.ghrelease.outputs.upload_url }}
220+
asset_path: "artifacts/${{ steps.package.outputs.package0 }}"
221+
asset_name: ${{ steps.package.outputs.package0 }}
222+
asset_content_type: application/zip
223+
224+
- name: Upload CLI to GitHub - netcoreapp3.1 linux-x64
225+
uses: actions/upload-release-asset@v1
226+
env:
227+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
228+
with:
229+
upload_url: ${{ steps.ghrelease.outputs.upload_url }}
230+
asset_path: "artifacts/${{ steps.package.outputs.package1 }}"
231+
asset_name: ${{ steps.package.outputs.package1 }}
232+
asset_content_type: application/zip
233+
234+
- name: Upload CLI to GitHub - netcoreapp3.1 osx-x64
235+
uses: actions/upload-release-asset@v1
236+
env:
237+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
238+
with:
239+
upload_url: ${{ steps.ghrelease.outputs.upload_url }}
240+
asset_path: "artifacts/${{ steps.package.outputs.package2 }}"
241+
asset_name: ${{ steps.package.outputs.package2 }}
242+
asset_content_type: application/zip
243+
244+
- name: Upload CLI to GitHub - netcoreapp3.1 win-x64
245+
uses: actions/upload-release-asset@v1
246+
env:
247+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
248+
with:
249+
upload_url: ${{ steps.ghrelease.outputs.upload_url }}
250+
asset_path: "artifacts/${{ steps.package.outputs.package3 }}"
251+
asset_name: ${{ steps.package.outputs.package3 }}
252+
asset_content_type: application/zip
146253

147254
# - name: Release to npm
148-
# if: steps.release.outputs.module == 'cli' && ((matrix.targetFramework == 'net461' && matrix.runtime == 'win-x64') || matrix.targetFramework == 'netcoreapp3.1')
149255
# uses: JS-DevTools/npm-publish@v1
150256
# with:
151257
# token: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
This provides some useful extensions for Azure Functions.
44

55

6-
## Getting Started [![Build status](https://ci.appveyor.com/api/projects/status/6ex8if2l1ffdahfq/branch/dev?svg=true)](https://ci.appveyor.com/project/justinyoo/azurefunctions-extensions/branch/dev) ##
7-
8-
* [Aliencube.AzureFunctions.Extensions.Configuration.AppSettings](./docs/app-settings.md): [![](https://img.shields.io/nuget/dt/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings/) [![](https://img.shields.io/nuget/v/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings/)
9-
* [Aliencube.AzureFunctions.Extensions.Configuration.Json](./docs/configuration-json.md): [![](https://img.shields.io/nuget/dt/Aliencube.AzureFunctions.Extensions.Configuration.Json.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.Configuration.Json/) [![](https://img.shields.io/nuget/v/Aliencube.AzureFunctions.Extensions.Configuration.Json.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.Configuration.Json/)
10-
* [Aliencube.AzureFunctions.Extensions.DependencyInjection](./docs/dependency-injection.md): [![](https://img.shields.io/nuget/dt/Aliencube.AzureFunctions.Extensions.DependencyInjection.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.DependencyInjection/) [![](https://img.shields.io/nuget/v/Aliencube.AzureFunctions.Extensions.DependencyInjection.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.DependencyInjection/)
11-
* [Aliencube.AzureFunctions.Extensions.OpenApi](./docs/openapi.md): [![](https://img.shields.io/nuget/dt/Aliencube.AzureFunctions.Extensions.OpenApi.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.OpenApi/) [![](https://img.shields.io/nuget/v/Aliencube.AzureFunctions.Extensions.OpenApi.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.OpenApi/)
6+
## Getting Started ![Build and Test](https://github.com/aliencube/AzureFunctions.Extensions/workflows/Build%20and%20Test/badge.svg) ##
7+
8+
| Package | Status | Version |
9+
| --- | --- | --- |
10+
| [Aliencube.AzureFunctions.Extensions.Configuration.AppSettings](./docs/app-settings.md) | [![](https://img.shields.io/nuget/dt/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings/) | [![](https://img.shields.io/nuget/v/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.Configuration.AppSettings/) |
11+
| [Aliencube.AzureFunctions.Extensions.Configuration.Json](./docs/configuration-json.md) | [![](https://img.shields.io/nuget/dt/Aliencube.AzureFunctions.Extensions.Configuration.Json.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.Configuration.Json/) | [![](https://img.shields.io/nuget/v/Aliencube.AzureFunctions.Extensions.Configuration.Json.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.Configuration.Json/) |
12+
| [Aliencube.AzureFunctions.Extensions.DependencyInjection](./docs/dependency-injection.md) | [![](https://img.shields.io/nuget/dt/Aliencube.AzureFunctions.Extensions.DependencyInjection.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.DependencyInjection/) | [![](https://img.shields.io/nuget/v/Aliencube.AzureFunctions.Extensions.DependencyInjection.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.DependencyInjection/) |
13+
| [Aliencube.AzureFunctions.Extensions.OpenApi](./docs/openapi.md) | [![](https://img.shields.io/nuget/dt/Aliencube.AzureFunctions.Extensions.OpenApi.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.OpenApi/) | [![](https://img.shields.io/nuget/v/Aliencube.AzureFunctions.Extensions.OpenApi.svg)](https://www.nuget.org/packages/Aliencube.AzureFunctions.Extensions.OpenApi/) |
14+
| Aliencube.AzureFunctions.Extensions.OpenApi.CLI | status | version |
1215

1316

1417
## Acknowledgement ##

0 commit comments

Comments
 (0)