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 #16 from DeeJayTC/vnext
Next Version 0.1.2
- Loading branch information
Showing
78 changed files
with
3,782 additions
and
1,153 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
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,74 @@ | ||
name: Build and deploy .NET Core application to windows webapp apigenerator with API Management Service ApiGeneratorSampleApIapi | ||
on: | ||
push: | ||
branches: | ||
- vnext | ||
env: | ||
AZURE_WEBAPP_NAME: apigenerator | ||
DOTNET_CORE_VERSION: 6.0.x | ||
WORKING_DIRECTORY: sample\ApiGeneratorSampleApp | ||
CONFIGURATION: Release | ||
AZURE_WEBAPP_PACKAGE_PATH: sample\ApiGeneratorSampleApp/publish | ||
AZURE_APIM_RESOURCE_PATH: /generated | ||
AZURE_APIM_RESOURCEGROUP: apigenerator_group | ||
AZURE_APIM_SERVICENAME: ApiGeneratorSampleApIapi | ||
AZURE_APIM_API_ID: ApiGeneratorSampleApI | ||
AZURE_APIM_APPSERVICEURL: https://apigenerator.azurewebsites.net:80/ | ||
SWASHBUCLE_ASPNET_CORE_CLI_PACKAGE_VERSION: 5.6.3 | ||
SWASHBUCKLE_DOTNET_CORE_VERSION: 3.1.x | ||
API_IMPORT_SPECIFICATION_PATH: sample\ApiGeneratorSampleApp/publish/swagger.json | ||
API_IMPORT_DLL: sample\ApiGeneratorSampleApp/publish/ApiGeneratorSampleApI.dll | ||
API_IMPORT_VERSION: v1 | ||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_CORE_VERSION }} | ||
- name: Setup SwashBuckle .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: ${{ env.SWASHBUCKLE_DOTNET_CORE_VERSION }} | ||
- name: Restore | ||
run: dotnet restore ${{ env.WORKING_DIRECTORY }} | ||
- name: Build | ||
run: dotnet build ${{ env.WORKING_DIRECTORY }} --configuration ${{ env.CONFIGURATION }} --no-restore | ||
- name: Test | ||
run: dotnet test ${{ env.WORKING_DIRECTORY }} --no-build | ||
- name: Publish | ||
run: dotnet publish ${{ env.WORKING_DIRECTORY }} --configuration ${{ env.CONFIGURATION }} --no-build --output ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | ||
- name: Install Swashbuckle CLI .NET Global Tool | ||
run: dotnet tool install --global Swashbuckle.AspNetCore.Cli --version ${{ env.SWASHBUCLE_ASPNET_CORE_CLI_PACKAGE_VERSION }} | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
- name: Publish Artifacts | ||
uses: actions/upload-artifact@v1.0.0 | ||
with: | ||
name: webapp | ||
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | ||
deploy: | ||
runs-on: windows-latest | ||
needs: build | ||
steps: | ||
- name: Download artifact from build job | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: webapp | ||
path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | ||
- name: Deploy to Azure WebApp | ||
uses: azure/webapps-deploy@v2 | ||
with: | ||
app-name: ${{ env.AZURE_WEBAPP_NAME }} | ||
package: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} | ||
publish-profile: ${{ secrets.apigenerator_c1d7 }} | ||
- name: Azure Login | ||
uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.ApiGeneratorSampleApIapi_spn }} | ||
- name: Import API into Azure API Management | ||
run: az apim api import --path "${{ env.AZURE_APIM_RESOURCE_PATH }}" --resource-group "${{ env.AZURE_APIM_RESOURCEGROUP }}" --service-name "${{ env.AZURE_APIM_SERVICENAME }}" --api-id "${{ env.AZURE_APIM_API_ID }}" --service-url "${{ env.AZURE_APIM_APPSERVICEURL }}" --specification-path "${{ env.API_IMPORT_SPECIFICATION_PATH }}" --specification-format OpenApi --subscription-required false | ||
- name: logout | ||
run: > | ||
az logout |
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
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,45 @@ | ||
[ | ||
|
||
{ | ||
"name": "MakeJSON", | ||
"route": "/MakeJSON", | ||
"idType": "int", | ||
"authorize": true, | ||
"scopesRead": [ "all.read" ], | ||
"scopesWrite": [ "all.write" ], | ||
"Fields": [ | ||
{ | ||
"name": "Name", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "Description", | ||
"Type": "string" | ||
|
||
} | ||
] | ||
}, | ||
{ | ||
"name": "CarJSON", | ||
"route": "/CarJSON", | ||
"idType": "int", | ||
"Fields": [ | ||
{ | ||
"name": "Name", | ||
"type": "string" | ||
}, | ||
{ | ||
"name": "Description", | ||
"Type": "string" | ||
}, | ||
{ | ||
"name": "Make", | ||
"type": "virtual MakeJSON" | ||
}, | ||
{ | ||
"name": "MakeId", | ||
"type": "int" | ||
} | ||
] | ||
} | ||
] |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.