Skip to content

Ensure stable object references for useSyncExternalStore (#949) #51

Ensure stable object references for useSyncExternalStore (#949)

Ensure stable object references for useSyncExternalStore (#949) #51

Workflow file for this run

name: Deploy schematic-js
permissions:
id-token: write
contents: read
on:
push:
tags:
- "schematic-js@*"
- "!schematic-js@*-rc*"
workflow_dispatch:
jobs:
lint_test:
name: Lint and Test
uses: ./.github/workflows/lint_test.yml
with:
package: schematic-js
working_dir: js
deploy:
name: Browser Deploy
runs-on: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/extras=s3-cache
needs: [lint_test]
steps:
- uses: runs-on/action@v2.0.3
- uses: actions/checkout@v6
- name: Set Node.js 24.x
uses: actions/setup-node@v6
with:
node-version: 24.x
- name: Yarn install
working-directory: ./js
run: yarn install
- name: Update version
working-directory: ./js
run: ./version.sh
- name: Build browser bundle
working-directory: ./js
run: yarn build:browser
- name: 🚀auth-oidc-aws-prod
uses: aws-actions/configure-aws-credentials@v6.0.0
with:
role-to-assume: ${{ vars.PROD_AWS_ROLE_ARN }}
aws-region: ${{ vars.PROD_AWS_REGION }}
- name: Get package version
id: package
run: |
echo "version=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT"
working-directory: ./js
- name: Deploy browser build
run: |
aws s3 cp dist/schematic.browser.js s3://${{ vars.PROD_JS_BUCKET_NAME }}/js/schematic.js
aws s3 cp dist/schematic.browser.js s3://${{ vars.PROD_JS_BUCKET_NAME }}/js/schematic.${{ steps.package.outputs.version }}.js
aws configure set preview.cloudfront true
aws cloudfront create-invalidation --distribution-id ${{ vars.PROD_JS_DISTRIBUTION_ID }} --paths "/js/schematic.js" "/js/schematic.${{ steps.package.outputs.version }}.js"
working-directory: ./js
publish:
name: NPM Publish
runs-on: runs-on=${{ github.run_id }}/runner=4cpu-linux-x64/extras=s3-cache
permissions:
packages: write
contents: read
needs: [lint_test]
steps:
- uses: runs-on/action@v2.0.3
- uses: actions/checkout@v6
- name: Set Node.js 24.x
uses: actions/setup-node@v6
with:
node-version: 24.x
- name: Publish schematic-js
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: TAG="${{ github.ref_name }}" ./scripts/publish-package.sh
notify_slack:
name: Notify Slack
runs-on: runs-on=${{ github.run_id }}/runner=1cpu-linux-arm64
needs: [deploy, publish]
steps:
- uses: rtCamp/action-slack-notify@v2.3.3
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_TITLE: Updated schematic-js
SLACK_ICON: https://schematic-public-assets.s3.amazonaws.com/logos/logo-transparent.png