Generate Bicep types for AWS #11
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
# ------------------------------------------------------------ | |
# Copyright 2023 The Radius Authors. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# ------------------------------------------------------------ | |
name: Generate Bicep types for AWS | |
on: | |
workflow_dispatch: | |
inputs: {} | |
jobs: | |
generate-types: | |
name: Generate Bicep types for AWS | |
runs-on: ubuntu-latest | |
env: | |
GOVER: '^1.21' | |
GOPROXY: https://proxy.golang.org | |
AWS_REGION: us-west-2 | |
steps: | |
- uses: actions/checkout@v3 | |
- id: get_commit_hash | |
name: Get commit hash (radius-project/bicep-types-aws) | |
run: | | |
echo "commit_hash_short=$(git rev-parse HEAD --short)" >> $GITHUB_OUTPUT | |
- id: get_date_string | |
name: Get date string | |
run: | | |
echo "date_string=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
- id: generate_branch_name | |
name: Generate branch name | |
run: | | |
echo "branch_name=generate-types-${{ steps.get_date_string.outputs.date_string }}-${{ steps.get_commit_hash.outputs.commit_hash_short }}" >> $GITHUB_OUTPUT | |
- name: Configure AWS | |
run: | | |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws configure set region ${{ env.AWS_REGION }} | |
aws configure set output json | |
- name: Install Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ env.GOVER }} | |
- name: Install node and npm | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Download AWS types | |
run: | | |
pushd ./src/aws-type-downloader | |
go run main.go --output ../../artifacts/types --clean | |
popd | |
- name: Generate AWS Bicep types | |
run: | | |
pushd ./src/aws-type-generator | |
npm ci | |
npm run start -- --input ../../artifacts/types --output ../../artifacts/bicep | |
popd | |
- name: Generate reference documentation | |
run: | | |
python ./.github/scripts/generate-reference-docs.py ./artifacts/types ./docs/reference/supported-resources.md | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
token: ${{ secrets.GH_RAD_CI_BOT_PAT }} | |
committer: rad-ci-bot <[email protected]> | |
author: rad-ci-bot <[email protected]> | |
signoff: false | |
branch: ${{ steps.generate_branch_name.outputs.branch_name }} | |
delete-branch: true | |
title: | | |
Generate bicep types for AWS: ${{ steps.get_date_string.outputs.date_string }} | |
body: | | |
## Autogenerated Report | |
- Downloaded AWS types from AWS Cloudcontrol on ${{ steps.get_date_string.outputs.date_string }} | |
- Generated Bicep types from AWS types | |
- Updated reference documentation | |
commit-message: | | |
Update Bicep types for AWS: ${{ steps.get_date_string.outputs.date_string }} | |
labels: | | |
autogenerated | |
github_actions | |
aws-types | |
draft: false |