generated from fossapps/Micro.Starter
-
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.
Merge pull request #37 from fossapps/auto-sdk
feat(sdk): introduce automatic sdk generation
- Loading branch information
Showing
4 changed files
with
58 additions
and
0 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,39 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
env: | ||
SERVICE_NAME: micro.keystore | ||
SERVICE_NAME_CAPITALIZED: Micro.Keystore | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: 3.1.101 | ||
- name: 'Load Docker Image' | ||
run: | | ||
TAG="${GITHUB_REF/refs\/tags\/v/}" | ||
docker pull fossapps/$SERVICE_NAME:$TAG | ||
- name: Spin-up Containers | ||
run: | | ||
TAG="${GITHUB_REF/refs\/tags\/v/}" | ||
TAG=$TAG docker-compose -f ./docker-compose.ci.yml up -d | ||
- name: Generate SDKs | ||
run: | | ||
cd ./Sdk | ||
sh ./generate_sdk.sh | ||
- name: pack | ||
run: | | ||
cd Sdk | ||
TAG="${GITHUB_REF/refs\/tags\/v/}" | ||
dotnet pack --include-symbols -p:PackageVersion=$TAG -c Release | ||
- name: release | ||
run: | | ||
cd Sdk | ||
dotnet nuget push ./bin/Release/Fossapps.Micro.KeyStore* -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json |
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 |
---|---|---|
|
@@ -60,3 +60,4 @@ _Resharper*/ | |
.idea/**/vcs.xml | ||
.idea/**/module.xml | ||
.idea/**/misc.xml | ||
./Sdk/Generated/** |
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,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<PackageId>Fossapps.Micro.KeyStore</PackageId> | ||
<Version>0.0.1</Version> | ||
<Authors>Nishchal Gautam</Authors> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" /> | ||
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="2.3.21" /> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.1.5" /> | ||
</ItemGroup> | ||
</Project> |
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,3 @@ | ||
#!/usr/bin/env bash | ||
mkdir -p Generated | ||
docker run --net=host --rm -v $(pwd)/Generated:/app/sdk node bash -c "apt update && apt install libunwind-dev -y && npm i -g [email protected] && autorest --input-file=http://localhost:5000/swagger/v1/swagger.json --csharp --namespace=Fossapps.Micro.KeyStore --override-client-name=KeyStoreClient --output-folder=/app/sdk --clear-output-folder" |