Task 26201743: Use bicep to publish az provider #3635
Workflow file for this run
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: Build | |
on: | |
push: | |
tags: | |
- "latest" | |
- "v*" | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: "Build" | |
runs-on: ubuntu-latest | |
env: | |
# don't print dotnet logo | |
DOTNET_NOLOGO: true | |
# disable telemetry (reduces dotnet tool output in logs) | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
- name: Build | |
run: dotnet build --configuration release | |
- name: Pack | |
run: dotnet pack --configuration release | |
- name: Upload Nuget packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: bicep-types-az-packages | |
path: ./out/* | |
if-no-files-found: error | |
- name: Test | |
run: dotnet test --configuration release --collect:"XPlat Code Coverage" --settings ./.github/workflows/codecov.runsettings | |
- name: Upload Code Coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
flags: dotnet | |
build-generator: | |
name: "Build Generator" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
submodules: recursive | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16.x | |
- name: Build bicep-types dependency | |
run: | | |
npm ci | |
npm run build | |
working-directory: bicep-types/src/bicep-types | |
- name: Install | |
run: npm ci | |
working-directory: ./src/generator | |
- name: Lint | |
run: npm run lint | |
working-directory: ./src/generator | |
- name: Build | |
run: npm run build | |
working-directory: ./src/generator | |
build-autorest: | |
name: "Build Autorest.Bicep" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
submodules: recursive | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16.x | |
- name: Build bicep-types dependency | |
run: | | |
npm ci | |
npm run build | |
working-directory: bicep-types/src/bicep-types | |
- name: Install | |
run: npm ci | |
working-directory: ./src/autorest.bicep | |
- name: Lint | |
run: npm run lint | |
working-directory: ./src/autorest.bicep | |
- name: Build | |
run: npm run build | |
working-directory: ./src/autorest.bicep | |
- name: Test | |
run: npm test | |
working-directory: ./src/autorest.bicep | |
test-github-scripts: | |
name: "Test GitHub Action Scripts" | |
environment: | |
name: test | |
permissions: | |
id-token: write | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Log in to Azure (tests dependency) | |
- name: Log in to Azure | |
uses: azure/login@v1 | |
with: | |
client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
# Install ORAS (tests dependency) | |
- name: Login to OCI Registry using ORAS | |
uses: oras-project/setup-oras@v1 | |
with: | |
version: 1.1.0 | |
# Log in to OCI Registry (tests dependency) | |
- name: Login to OCI Registry using ORAS | |
run: | | |
ACR_TOKEN=$(az acr login -t \ | |
-n ${{ secrets.PUBLISH_REGISTRY_SERVER }} \ | |
-o tsv --query accessToken) | |
oras login --password-stdin ${{ secrets.PUBLISH_REGISTRY_SERVER }} <<< "$ACR_TOKEN" | |
- name: Install the Bicep CLI | |
env: | |
GH_TOKEN: ${{ github.token }} | |
# Uses the Bicep bits from the main branch | |
run: bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) | |
- name: Fetch test dependencies | |
run: npm ci | |
working-directory: ./scripts/github-actions | |
- name: Test | |
run: npm test | |
working-directory: ./scripts/github-actions |