diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml deleted file mode 100644 index 4e703a60e..000000000 --- a/.github/workflows/chromatic.yml +++ /dev/null @@ -1,316 +0,0 @@ -name: 'Chromatic' - -on: - pull_request: - push: - branches: [main] - -permissions: - contents: read - -jobs: - chromatic-vanilla: - name: Chromatic (Vanilla) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: oven-sh/setup-bun@v1 - - run: bun install && bun run build - - - name: Check for Chromatic token - id: check - run: | - if [ -n "$TOKEN" ]; then - echo "has-token=true" >> "$GITHUB_OUTPUT" - else - echo "has-token=false" >> "$GITHUB_OUTPUT" - fi - env: - TOKEN: ${{ secrets.CHROMATIC_VANILLA_TOKEN }} - - - name: Publish to Chromatic - if: steps.check.outputs.has-token == 'true' - uses: chromaui/action@v15 - id: vanilla - with: - token: ${{ secrets.GITHUB_TOKEN }} - projectToken: ${{ secrets.CHROMATIC_VANILLA_TOKEN }} - buildScriptName: 'build' - workingDir: 'apps/stories-vanilla' - - - name: Build Storybook (fork fallback) - if: steps.check.outputs.has-token == 'false' - working-directory: apps/stories-vanilla - run: bun run build - - - name: Upload Storybook artifact - if: steps.check.outputs.has-token == 'false' - uses: actions/upload-artifact@v4 - with: - name: storybook-vanilla - path: apps/stories-vanilla/storybook-static - retention-days: 30 - - outputs: - storybookUrl: ${{ steps.vanilla.outputs.storybookUrl }} - has-token: ${{ steps.check.outputs.has-token }} - - chromatic-vue: - name: Chromatic (Vue) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: oven-sh/setup-bun@v1 - - run: bun install && bun run build - - - name: Check for Chromatic token - id: check - run: | - if [ -n "$TOKEN" ]; then - echo "has-token=true" >> "$GITHUB_OUTPUT" - else - echo "has-token=false" >> "$GITHUB_OUTPUT" - fi - env: - TOKEN: ${{ secrets.CHROMATIC_VUE_TOKEN }} - - - name: Publish to Chromatic - if: steps.check.outputs.has-token == 'true' - uses: chromaui/action@v15 - id: vue - with: - token: ${{ secrets.GITHUB_TOKEN }} - projectToken: ${{ secrets.CHROMATIC_VUE_TOKEN }} - buildScriptName: 'build' - workingDir: 'apps/stories-vue' - - - name: Build Storybook (fork fallback) - if: steps.check.outputs.has-token == 'false' - working-directory: apps/stories-vue - run: bun run build - - - name: Upload Storybook artifact - if: steps.check.outputs.has-token == 'false' - uses: actions/upload-artifact@v4 - with: - name: storybook-vue - path: apps/stories-vue/storybook-static - retention-days: 30 - - outputs: - storybookUrl: ${{ steps.vue.outputs.storybookUrl }} - has-token: ${{ steps.check.outputs.has-token }} - - chromatic-solid: - name: Chromatic (Solid) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: oven-sh/setup-bun@v1 - - run: bun install && bun run build - - - name: Check for Chromatic token - id: check - run: | - if [ -n "$TOKEN" ]; then - echo "has-token=true" >> "$GITHUB_OUTPUT" - else - echo "has-token=false" >> "$GITHUB_OUTPUT" - fi - env: - TOKEN: ${{ secrets.CHROMATIC_SOLID_TOKEN }} - - - name: Publish to Chromatic - if: steps.check.outputs.has-token == 'true' - uses: chromaui/action@v15 - id: solid - with: - token: ${{ secrets.GITHUB_TOKEN }} - projectToken: ${{ secrets.CHROMATIC_SOLID_TOKEN }} - buildScriptName: 'build' - workingDir: 'apps/stories-solid' - - - name: Build Storybook (fork fallback) - if: steps.check.outputs.has-token == 'false' - working-directory: apps/stories-solid - run: bun run build - - - name: Upload Storybook artifact - if: steps.check.outputs.has-token == 'false' - uses: actions/upload-artifact@v4 - with: - name: storybook-solid - path: apps/stories-solid/storybook-static - retention-days: 30 - - outputs: - storybookUrl: ${{ steps.solid.outputs.storybookUrl }} - has-token: ${{ steps.check.outputs.has-token }} - - chromatic-svelte: - name: Chromatic (Svelte) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: oven-sh/setup-bun@v1 - - run: bun install && bun run build - - - name: Check for Chromatic token - id: check - run: | - if [ -n "$TOKEN" ]; then - echo "has-token=true" >> "$GITHUB_OUTPUT" - else - echo "has-token=false" >> "$GITHUB_OUTPUT" - fi - env: - TOKEN: ${{ secrets.CHROMATIC_SVELTE_TOKEN }} - - - name: Publish to Chromatic - if: steps.check.outputs.has-token == 'true' - uses: chromaui/action@v15 - id: svelte - with: - token: ${{ secrets.GITHUB_TOKEN }} - projectToken: ${{ secrets.CHROMATIC_SVELTE_TOKEN }} - buildScriptName: 'build' - workingDir: 'apps/stories-svelte' - - - name: Build Storybook (fork fallback) - if: steps.check.outputs.has-token == 'false' - working-directory: apps/stories-svelte - run: bun run build - - - name: Upload Storybook artifact - if: steps.check.outputs.has-token == 'false' - uses: actions/upload-artifact@v4 - with: - name: storybook-svelte - path: apps/stories-svelte/storybook-static - retention-days: 30 - - outputs: - storybookUrl: ${{ steps.svelte.outputs.storybookUrl }} - has-token: ${{ steps.check.outputs.has-token }} - - chromatic: - name: Chromatic - runs-on: ubuntu-latest - needs: - - chromatic-vanilla - - chromatic-vue - - chromatic-solid - - chromatic-svelte - permissions: - contents: read - pull-requests: write - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: oven-sh/setup-bun@v1 - - run: bun install && bun run build - - - name: Check for Chromatic token - id: check - run: | - if [ -n "$TOKEN" ]; then - echo "has-token=true" >> "$GITHUB_OUTPUT" - else - echo "has-token=false" >> "$GITHUB_OUTPUT" - fi - env: - TOKEN: ${{ secrets.CHROMATIC_TOKEN }} - - - name: Publish to Chromatic - if: steps.check.outputs.has-token == 'true' - uses: chromaui/action@v15 - with: - token: ${{ secrets.GITHUB_TOKEN }} - projectToken: ${{ secrets.CHROMATIC_TOKEN }} - buildScriptName: 'build' - workingDir: 'apps/stories' - env: - VANILLA_STORYBOOK_URL: ${{ needs.chromatic-vanilla.outputs.storybookUrl }} - VUE_STORYBOOK_URL: ${{ needs.chromatic-vue.outputs.storybookUrl }} - SOLID_STORYBOOK_URL: ${{ needs.chromatic-solid.outputs.storybookUrl }} - SVELTE_STORYBOOK_URL: ${{ needs.chromatic-svelte.outputs.storybookUrl }} - - - name: Build Storybook (fork fallback) - if: steps.check.outputs.has-token == 'false' - working-directory: apps/stories - run: bun run build - - - name: Upload Storybook artifact - if: steps.check.outputs.has-token == 'false' - uses: actions/upload-artifact@v4 - with: - name: storybook-react - path: apps/stories/storybook-static - retention-days: 30 - - - name: Summary - if: steps.check.outputs.has-token == 'false' && github.event_name == 'pull_request' - uses: actions/github-script@v7 - with: - script: | - const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; - - const body = [ - `### Storybook Preview (Fork PR)`, - ``, - `Chromatic was skipped because the Chromatic project tokens are not available on fork PRs.`, - `Storybook builds have been uploaded as workflow artifacts instead:`, - ``, - `| Storybook | Artifact |`, - `| --- | --- |`, - `| React | \`storybook-react\` |`, - `| Vanilla | \`storybook-vanilla\` |`, - `| Vue | \`storybook-vue\` |`, - `| Solid | \`storybook-solid\` |`, - `| Svelte | \`storybook-svelte\` |`, - ``, - `Download artifacts from the [workflow run](${runUrl}) and open \`index.html\` to preview.`, - ].join('\n'); - - // Check for an existing comment to update - const { data: comments } = await github.rest.issues.listComments({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - }); - - const marker = '### Storybook Preview (Fork PR)'; - const existing = comments.find(c => c.body?.startsWith(marker)); - - if (existing) { - await github.rest.issues.updateComment({ - owner: context.repo.owner, - repo: context.repo.repo, - comment_id: existing.id, - body, - }); - } else { - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - body, - }); - } - - core.summary.addHeading('Storybook Preview (Fork PR)', 2); - core.summary.addRaw( - 'Chromatic was skipped because project tokens are not available on fork PRs. ' + - 'Storybook builds have been uploaded as workflow artifacts. ' + - 'Download them from the Artifacts section of this workflow run to preview changes locally.' - ); - await core.summary.write(); diff --git a/.github/workflows/continous-release.yml b/.github/workflows/continous-release.yml deleted file mode 100644 index f89bfa5d8..000000000 --- a/.github/workflows/continous-release.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Continuous Release -on: - pull_request: - push: - branches: [main] - -permissions: - contents: read - -jobs: - build: - name: Continuous release - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20 - # https://github.com/atlassian/changesets/issues/550#issuecomment-811245508 - registry-url: https://registry.npmjs.org - - - uses: oven-sh/setup-bun@v1 - - run: bun install && bun run build - - - name: Publish - run: npx pkg-pr-new publish './packages/*' diff --git a/.github/workflows/playwright.yml b/.github/workflows/playwright.yml deleted file mode 100644 index fd25b712a..000000000 --- a/.github/workflows/playwright.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Playwright - -on: - pull_request: - push: - branches: [main] - -permissions: - contents: read - -jobs: - e2e: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Setup Bun - uses: oven-sh/setup-bun@v1 - with: - bun-version: latest - - - name: Install Dependencies - run: bun install - - - name: Install Playwright Browsers - run: bunx playwright install --with-deps chromium - - - name: Build Packages - run: bun run build - - - name: Run Playwright Tests (React) - working-directory: apps/stories - run: bunx playwright test - - - name: Run Playwright Tests (Vue) - working-directory: apps/stories-vue - run: bunx playwright test - - - name: Run Playwright Tests (Solid) - working-directory: apps/stories-solid - run: bunx playwright test - - - name: Upload Test Results - uses: actions/upload-artifact@v4 - if: ${{ !cancelled() }} - with: - name: playwright-report - path: | - apps/stories/playwright-report/ - apps/stories-vue/playwright-report/ - apps/stories-solid/playwright-report/ - retention-days: 14 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 57bf1cfe2..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: Release -on: - push: - branches: - - main - -permissions: - contents: read - -jobs: - release: - name: ${{ matrix.channel }} - runs-on: ubuntu-latest - environment: production - permissions: - id-token: write # Required for OIDC - contents: write # Required for changesets/action@v1 - pull-requests: write # Required for changesets/action@v1 - strategy: - max-parallel: 1 - matrix: - channel: - - current - - beta - steps: - - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 - with: - fetch-depth: 0 - - - name: Setup node - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 - with: - node-version: '20' - # https://github.com/atlassian/changesets/issues/550#issuecomment-811245508 - registry-url: 'https://registry.npmjs.org' - - # npm 11.5.1+ is required for OIDC trusted publishing to npm. - - run: npm install -g npm@11 - - - uses: oven-sh/setup-bun@f4d14e03ff726c06358e5557344e1da148b56cf7 # v1 - - run: bun install && bun run build - - - name: Create Release Pull Request or Publish to npm - if: matrix.channel == 'current' - uses: changesets/action@d94a5c301145045a0960133674e003b265942a22 # v1.8.0 - with: - publish: npm run release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Publish packages on npm with @beta tag - if: matrix.channel == 'beta' - run: | - npm run version-packages:beta - npm run release:beta - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 7cd11105e..000000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Tests - -on: - pull_request: - push: - branches: [main] - -permissions: - contents: read - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Setup Bun - uses: oven-sh/setup-bun@v1 - with: - bun-version: latest - - - name: Install Dependencies - run: bun install - - - name: Run Tests - run: bun run test diff --git a/.github/workflows/tiered.pre_merge.yml b/.github/workflows/tiered.pre_merge.yml new file mode 100644 index 000000000..72dfccaa0 --- /dev/null +++ b/.github/workflows/tiered.pre_merge.yml @@ -0,0 +1,49 @@ +name: tiered.pre_merge +on: + pull_request: + types: [labeled] +# uses source branch as concurrency group, only runs latest workflow for the source branch +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref }} + cancel-in-progress: true +permissions: + contents: read + issues: write + pull-requests: write +jobs: + requirements: + if: ${{ contains(github.event.label.name, 'Ok to test') }} + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Remove label + uses: actions/github-script@v7 + continue-on-error: true + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + github.rest.issues.removeLabel({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + name: 'Ok to test' + }) + test: + needs: requirements + if: ${{ contains(github.event.label.name, 'Ok to test') }} + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + + - name: Install dependencies + run: bun install + + - name: Test + run: bun run test diff --git a/bun.lockb b/bun.lockb index 63ddc635c..65aec4842 100755 Binary files a/bun.lockb and b/bun.lockb differ