Skip to content

fix(popover): delay visibility check when hiding by a frame to ensure… #493

fix(popover): delay visibility check when hiding by a frame to ensure…

fix(popover): delay visibility check when hiding by a frame to ensure… #493

Workflow file for this run

name: Build and Release
on:
push:
branches:
- main
paths:
- 'forge.json'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '.eslintrc.json'
- '.stylelintrc'
- '.autorc'
- '.github/workflows/**/*'
- '.storybook/**/*'
- 'src/**/*'
workflow_dispatch:
concurrency: build-release
jobs:
## Gather configuration required by other jobs
wf-config:
name: Workflow Configuration
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Prepare Repository
run: git fetch --unshallow --tags
- name: Cache Dependencies
id: cache
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Use Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install
id: install
run: npm ci
## Determine if this is a release build or not, which will affect which dependent jobs run below
- name: Detect Release Status
id: detect-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.FORGE_NPM_TOKEN }}
run: |
## We use `auto version` to calculate whether this is a release build or not
VERSION_RESULT=$(npx auto version)
echo "Version calculation result: ${VERSION_RESULT}"
if [[ "${VERSION_RESULT}" =~ (major|minor|patch|release)$ ]]; then
echo "Release: true"
echo "release=true" >> $GITHUB_OUTPUT
else
echo "Release: false"
echo "release=false" >> $GITHUB_OUTPUT
fi
## Detect if any specific files we care about have changed to help us know if we need to execute a CI build or Storybook deployment at all or not
- name: Check File Changes
uses: dorny/paths-filter@v3
id: file-filter
with:
filters: |
build:
- 'forge.json'
- 'tsconfig.json'
- 'package.json'
- 'package-lock.json'
- '.eslintrc.json'
- '.stylelintrc'
- '.autorc'
- '.github/workflows/**'
- 'src/lib/**'
test:
- 'src/lib/**'
- 'src/test/**'
storybook:
- '.storybook/**'
- 'src/lib/**'
- 'src/stories/**'
outputs:
is-release: ${{ steps.detect-release.outputs.release }}
build-files-changed: ${{ steps.file-filter.outputs.build == 'true' }}
test-files-changed: ${{ steps.file-filter.outputs.test == 'true' }}
deploy-storybook: ${{ steps.file-filter.outputs.storybook == 'true' }}
# This job will run on non-release builds for general CI validation only if files are changed that need to be built or tested
build:
name: Build and Test
needs: wf-config
uses: tyler-technologies-oss/forge-automation-shared/.github/workflows/wf-build-and-test.yml@v2.10.3
if: ${{ needs.wf-config.outputs.is-release == 'false' && (needs.wf-config.outputs.build-files-changed == 'true' || needs.wf-config.outputs.test-files-changed == 'true') }}
with:
BUILD_ENABLED: ${{ needs.wf-config.outputs.build-files-changed == 'true' }}
TESTS_ENABLED: ${{ needs.wf-config.outputs.test-files-changed == 'true' }}
secrets:
NPM_TOKEN: ${{ secrets.FORGE_NPM_TOKEN }}
## This job will run on release builds when publishing a new version
build-and-release:
name: Build and Release
needs: wf-config
uses: tyler-technologies-oss/forge-automation-shared/.github/workflows/wf-build-release.yml@v2.10.3
if: ${{ needs.wf-config.outputs.is-release == 'true' }}
with:
PRODUCTION_RELEASE: true
TESTS_ENABLED: false
PACKAGE_ASSETS_ARCHIVE_PATH: "dist/deployment-assets.tar.gz"
PACKAGE_ASSETS_ENABLED: true
secrets:
GITHUB_APP_ID: ${{ secrets.FORGE_AUTOBOT_ID }}
GITHUB_APP_KEY: ${{ secrets.FORGE_AUTOBOT_SECRET }}
NPM_TOKEN: ${{ secrets.FORGE_NPM_TOKEN }}
## This job will run only on release builds
publish-cdn:
name: Publish Components to CDN
needs: [wf-config, build-and-release]
uses: tyler-technologies-oss/forge-automation-shared/.github/workflows/wf-publish-cloudfront-assets.yml@v2.10.3
if: ${{ needs.wf-config.outputs.is-release == 'true' }}
with:
AWS_REGION: "us-east-1"
MAX_CLOUDFRONT_INVALIDATIONS: 25
INVALIDATE: false # We do not invalidate the CloudFront cache because we're only pushing new assets
secrets:
AWS_IAM_ROLE: ${{ secrets.AWS_IAM_ROLE }}
AWS_S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }}
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }}
## We run this job only when files that effect Storybook are found in the changed files
deploy-storybook:
name: Deploy Storybook
needs: wf-config
uses: tyler-technologies-oss/forge-automation-shared/.github/workflows/wf-publish-gh-pages.yml@v2.10.3
if: ${{ needs.wf-config.outputs.is-release == 'true' && needs.wf-config.outputs.deploy-storybook == 'true' }}
with:
PRODUCTION_RELEASE: true
BUILD_DIRECTORY: storybook-static
BUILD_TARGET_DIRECTORY: docs/${{ github.head_ref || github.ref_name }}
BUILD_NPM_SCRIPT: "build-storybook"
PR_COMMENT_HEADER: "View Storybook Deployment"
secrets:
GITHUB_DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.FORGE_NPM_TOKEN }}