Skip to content

Commit

Permalink
use bicep to publish provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariel Silverman committed Dec 19, 2023
1 parent e267036 commit cf0104f
Showing 1 changed file with 9 additions and 40 deletions.
49 changes: 9 additions & 40 deletions .github/workflows/publish-types.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,29 +31,11 @@ jobs:
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

# Installing ORAS (publish-az-types.js dependency)
- name: Login to OCI Registry using ORAS
uses: oras-project/setup-oras@v1
with:
version: 1.1.0

# Logging into OCI Registry (publish-az-types.js dependency)
- name: Login to OCI Registry using ORAS
run: |
az acr login -t -n ${{ secrets.PUBLISH_REGISTRY_SERVER }} -o tsv --query accessToken | oras login --password-stdin ${{ secrets.PUBLISH_REGISTRY_SERVER }}
# # Logging into OCI Registry (publish-az-types.js dependency)
# - name: Login to OCI Registry using ORAS
# run: |
# az acr login -t -n ${{ secrets.PUBLISH_REGISTRY_SERVER }} -o tsv --query accessToken | oras login --password-stdin ${{ secrets.PUBLISH_REGISTRY_SERVER }}

# Installing ORAS (publish-az-types.js dependency)
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 16.x

# Installing publish-az-types.js NPM package dependencies
- name: Fetch publish script dependencies
working-directory: ./scripts/github-actions
run: |
npm ci
- name: Generate tag for the package based on event type
id: generate_tag
run: |
Expand All @@ -63,22 +45,9 @@ jobs:
echo "tag=0.0.0-alpha-pr${{ github.event.number }}" >> $GITHUB_OUTPUT
fi
- name: Publish Package
- name: Intall Bicep CLI
run: curl -s https://raw.githubusercontent.com/Azure/bicep/main/scripts/install_cli_nightly.sh

- name: Publish Azure Resource Types
id: publish-types
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const path = require("path");
const cwd = process.cwd();
typesDir = path.join(cwd, "generated");
process.chdir(path.join(cwd, "scripts/github-actions"));
console.log("currentDir: " + process.cwd());
const script = require("./publish-az-types.js");
return await script({
require: require,
core: core,
typesDir: typesDir,
registryFqdn: "${{ secrets.PUBLISH_REGISTRY_SERVER }}",
tags: "${{ steps.generate_tag.outputs.tag }}",
});
run: ~/.azure/bin/bicep publish-provider ./generated --target "br:${{ secrets.PUBLISH_REGISTRY_SERVER }}/bicep/providers/az:${{ steps.generate_tag.outputs.tag }}"

0 comments on commit cf0104f

Please sign in to comment.