Generate Single #28
Workflow file for this run
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: Generate Single | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| api_specs_ref: | |
| description: 'Git ref or full SHA for https://github.com/Azure/azure-rest-api-specs.' | |
| required: true | |
| default: 'main' | |
| single_path: | |
| description: 'The path to generate types for (e.g. "compute/resource-manager", or "keyvault/resource-manager").' | |
| required: true | |
| jobs: | |
| update-schemas: | |
| name: Update Schemas | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-22.04 #Pinning the image to a specific version due to an issue with ICU packages in the latest image https://github.com/actions/runner-images/issues/10989 | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Clone azure-rest-api-specs | |
| uses: actions/checkout@v6 | |
| with: | |
| repository: Azure/azure-rest-api-specs | |
| path: workflow-temp/azure-rest-api-specs | |
| ref: ${{ github.event.inputs.api_specs_ref }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20.x | |
| - name: Install generator npm packages | |
| run: npm ci | |
| working-directory: generator | |
| - name: Build bicep-types | |
| run: | | |
| npm ci | |
| npm run build | |
| working-directory: bicep-types-az/bicep-types/src/bicep-types | |
| - name: Build autorest.bicep | |
| run: | | |
| npm ci | |
| npm run build | |
| working-directory: bicep-types-az/src/autorest.bicep | |
| - name: Run generator | |
| run: | | |
| npm run generate-single -- \ | |
| --specs-dir "$GITHUB_WORKSPACE/workflow-temp/azure-rest-api-specs" \ | |
| --base-path '${{ github.event.inputs.single_path }}' | |
| working-directory: generator | |
| - name: Update resources.json | |
| run: | | |
| npm run list-resources | |
| working-directory: generator | |
| - name: Push to git branch | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_message: Update Generated Schemas (${{ github.event.inputs.single_path }}) | |
| branch: autogenerate-single/${{ github.event.inputs.single_path }} | |
| push_options: '--force' | |
| create_branch: true |