forked from Ed-Fi-Alliance-OSS/AdminAPI-1.x
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create github action to generate openapi and md file. Modify build.ps…
…1 to include steps to build and generate openapi and md file
- Loading branch information
1 parent
7c8f6a2
commit 767439e
Showing
2 changed files
with
113 additions
and
1 deletion.
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,69 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Licensed to the Ed-Fi Alliance under one or more agreements. | ||
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. | ||
# See the LICENSE and NOTICES files in the project root for more information. | ||
|
||
name: Create PR to update doc and openapi definition | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'API Version [format 0.0.0]' | ||
required: true | ||
type: string | ||
permissions: write-all | ||
|
||
env: | ||
CI_COMMIT_MESSAGE: Continuous Integration Build Artifacts | ||
CI_COMMIT_AUTHOR: github-actions[bot] | ||
CI_COMMIT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com | ||
|
||
jobs: | ||
create-doc-and-openapiyaml: | ||
name: Build C# | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: pwsh | ||
steps: | ||
- name: Checkout the Repo | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: Git create branch | ||
run: git checkout -b openapi-${{ inputs.version }} | ||
|
||
- name: Install Swashbuckle CLI | ||
run: dotnet tool install Swashbuckle.AspNetCore.Cli --version 6.5.0 --create-manifest-if-needed | ||
|
||
- name: Install widdershins CLI | ||
run: npm install -g widdershins | ||
|
||
- name: Set issuer and signingkey | ||
run: ./build.ps1 -Command Build -Configuration Debug | ||
|
||
- name: Build | ||
run: | | ||
$p = @{ | ||
Authority = "http://api" | ||
IssuerUrl = "https://localhost" | ||
DatabaseEngine = "PostgreSql" | ||
PathBase = "adminapi" | ||
SigningKey = "test" | ||
AdminDB = "host=db-admin;port=5432;username=username;password=password;database=EdFi_Admin;Application Name=EdFi.Ods.AdminApi;" | ||
SecurityDB = "host=db-admin;port=5432;username=username;password=password;database=EdFi_Security;Application Name=EdFi.Ods.AdminApi;" | ||
} | ||
./build.ps1 -APIVersion ${{ inputs.version }} -Configuration Release -DockerEnvValues $p -Command GenerateOpenAPIAndMD | ||
- name: GIT commit and push | ||
run: | | ||
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}" | ||
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}" | ||
git add . | ||
git commit -m "${{ env.CI_COMMIT_MESSAGE }}" | ||
git push --set-upstream origin openapi-${{ inputs.version }} | ||
- name: Create pull request | ||
run: gh pr create -B main -H test1 --title 'Merge test1 into main' --body 'Created by Github action' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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