generator - rename ApiVersion func to AzureAPIVersion to avoid co…
#1377
This file contains hidden or 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: Regenerate the Go SDK | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'api-definitions/**' | |
| - 'tools/generator-go-sdk/**' | |
| workflow_dispatch: # for manual invocations | |
| concurrency: | |
| group: 'regengosdk-${{ github.head_ref }}' | |
| cancel-in-progress: true | |
| jobs: | |
| regenerate-go-sdk: | |
| runs-on: custom-linux-xl | |
| steps: | |
| - name: mount a ramdisk to working dir | |
| run: | | |
| sudo mount -t tmpfs -o size=32G tmpfs $GITHUB_WORKSPACE | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 | |
| - uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0 | |
| with: | |
| go-version-file: ./.go-version | |
| cache-dependency-path: | | |
| tools/generator-go-sdk/go.mod | |
| tools/data-api-differ/go.mod | |
| tools/wrapper-automation/go.mod | |
| tools/data-api/go.mod | |
| tools/importer-msgraph-metadata/go.mod | |
| tools/data-api-sdk/go.mod | |
| tools/sdk/go.mod | |
| tools/importer-rest-api-specs/go.mod | |
| tools/data-api-repository/go.mod | |
| tools/version-bumper/go.mod | |
| tools/generator-terraform/go.mod | |
| - name: ensure goimports is installed | |
| run: | | |
| go install golang.org/x/tools/cmd/goimports@latest | |
| - name: "Launch SSH Agent" | |
| run: | | |
| # launch an ssh agent and export it's env vars | |
| ssh-agent -a $SSH_AUTH_SOCK > /dev/null | |
| env: | |
| SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock | |
| - name: "Load SSH Key" | |
| run: | | |
| # load the Deployment Write Key for the Go SDK repository | |
| echo "${{ secrets.GOSDK_DEPLOYMENT_WRITE_KEY }}" | ssh-add - | |
| env: | |
| SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock | |
| - name: "Run the Go SDK Generator" | |
| run: | | |
| # go go gadget generator | |
| ./scripts/automation-generate-and-commit-go-sdk.sh | |
| env: | |
| SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock | |
| - name: "Remove the Key from the SSH Agent" | |
| if: always() | |
| run: | | |
| # remove the ssh key | |
| ssh-add -D | |
| env: | |
| SSH_AUTH_SOCK: /tmp/pandora_ssh_agent.sock | |
| - name: "Terminate the SSH Agent" | |
| if: always() | |
| run: | | |
| pkill -9 ssh-agent |