demonstrate workflow. Changed model.bh-graph.itkin .data additionalP… #1
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
name: Generate SDK and Version (Test) | |
on: | |
push: | |
branches: | |
- feature/new-openapi-invokes-generation | |
paths: | |
- 'openapi/openapi.json' | |
permissions: | |
contents: write | |
jobs: | |
generate-sdk: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Set up Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.20' | |
- name: Install oapi-codegen | |
run: go install github.com/deepmap/oapi-codegen/cmd/oapi-codegen@latest | |
- name: Generate sdk.go | |
run: oapi-codegen -generate types,client,spec -package oapiclient -o ./sdk/oapicodegenfromdoc.json ./openapi/openapi.json | |
- name: Generate version.go | |
run: | | |
TAG="v1.0.0-test" # Use a test version | |
cat <<EOF > version.go | |
package sdk | |
// Version of the SDK | |
const Version = "$TAG" | |
EOF | |
- name: Configure Git | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Commit changes | |
run: | | |
git add sdk/oapicodegenfromdocjson.go sdk/version.go | |
git commit -m "Generate sdk.go and version.go for test version" | |
- name: Push changes | |
uses: ad-m/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: test-sdk-generation |