Schema update #17
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@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "20.x" | |
cache: "npm" | |
registry-url: "https://registry.npmjs.org" | |
- name: NPM install | |
run: npm ci | |
- name: First build | |
run: npm run build | |
- id: download | |
if: github.ref == 'refs/heads/main' | |
name: Download latest | |
run: npm run download | |
continue-on-error: true | |
- name: Generate Types | |
if: steps.download.outcome == 'success' | |
run: npm run generate:cached | |
- name: Build with new types | |
if: steps.download.outcome == 'success' | |
run: npm run build | |
- name: Configure Git | |
if: steps.download.outcome == 'success' | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
run: | | |
set -e | |
git config user.email "actions@github.com" | |
git config user.name "Github Actions" | |
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
- name: Commit changes | |
if: steps.download.outcome == 'success' | |
run: | | |
set -e | |
git add -A | |
git commit -m "update schemas" | |
- name: Bump @awboost/cfn-resource-types version | |
if: steps.download.outcome == 'success' | |
run: npm version -w @awboost/cfn-resource-types patch | |
- name: Publish @awboost/cfn-resource-types | |
if: steps.download.outcome == 'success' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: npm publish -w @awboost/cfn-resource-types |