Schema update #422
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: Schema update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Git Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
cache: "npm" | |
registry-url: "https://registry.npmjs.org" | |
- name: NPM install | |
run: npm ci | |
- name: Build | |
run: npm run build | |
- id: download | |
name: Download latest | |
continue-on-error: true | |
run: npm run download | |
- id: generate | |
name: Generate Types | |
if: ${{ steps.download.outcome == 'success' || github.event_name == 'workflow_dispatch' }} | |
run: npm run generate:cached -- --ignore-broken-refs | |
- name: Generate Types (Legacy) | |
if: ${{ steps.generate.outcome == 'success' }} | |
run: npm run generate:legacy -- --ignore-broken-refs | |
- name: Build with new types | |
if: ${{ steps.generate.outcome == 'success' }} | |
run: npm run compile && npm run lint | |
- name: Configure Git | |
if: ${{ steps.generate.outcome == 'success' }} | |
shell: bash | |
run: | | |
git config user.email "[email protected]" | |
git config user.name "Github Actions" | |
- id: commit | |
name: Commit changes | |
if: ${{ steps.generate.outcome == 'success' }} | |
continue-on-error: true | |
run: git add -A && git commit -m "update schemas" | |
- name: Bump @awboost/cfn-resource-schemas-db | |
if: ${{ steps.commit.outcome == 'success' }} | |
run: npm run -w @awboost/cfn-resource-schemas-db bump | |
- name: Bump @awboost/cfn-resource-types version | |
if: ${{ steps.commit.outcome == 'success' }} | |
run: npm run -w @awboost/cfn-resource-types bump | |
- name: Bump @awboost/cfntypes version | |
if: ${{ steps.commit.outcome == 'success' }} | |
run: npm run -w @awboost/cfntypes bump | |
- name: Push changes | |
if: ${{ steps.commit.outcome == 'success' }} | |
run: git push --follow-tags | |
- name: Publish @awboost/cfn-resource-types | |
if: ${{ steps.commit.outcome == 'success' }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm publish -w @awboost/cfn-resource-types | |
- name: Publish @awboost/cfntypes | |
if: ${{ steps.commit.outcome == 'success' }} | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm publish -w @awboost/cfntypes |