From 7d8c9c7f6b622deb98d5fd89f0cf36c4a24a8f17 Mon Sep 17 00:00:00 2001 From: Cody Kaup Date: Thu, 17 Oct 2024 16:35:56 -0500 Subject: [PATCH 1/3] Also run lint-and-test in merge queue --- .github/workflows/lint-and-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-and-test.yml b/.github/workflows/lint-and-test.yml index 24a6a65c5..9463c31b5 100644 --- a/.github/workflows/lint-and-test.yml +++ b/.github/workflows/lint-and-test.yml @@ -1,5 +1,5 @@ name: Lint and Test -on: push +on: [push, merge_group] permissions: contents: read From aa68778b8b1dbeeca0b5db0e8d1e2d580cd98ec0 Mon Sep 17 00:00:00 2001 From: Cody Kaup Date: Thu, 17 Oct 2024 16:50:01 -0500 Subject: [PATCH 2/3] Push and test against action-next --- .github/workflows/smoke-test-action-next.yml | 32 ++++++++++++++++ package.json | 1 + scripts/releaseNext.mjs | 39 ++++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100755 .github/workflows/smoke-test-action-next.yml create mode 100755 scripts/releaseNext.mjs diff --git a/.github/workflows/smoke-test-action-next.yml b/.github/workflows/smoke-test-action-next.yml new file mode 100755 index 000000000..c0c4f7f44 --- /dev/null +++ b/.github/workflows/smoke-test-action-next.yml @@ -0,0 +1,32 @@ +name: Smoke test via action next +on: merge_group + +permissions: + contents: read + +jobs: + lint-and-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: lts/* + - run: corepack enable + - run: yarn + - name: Push to action-next + run: yarn run release-next + env: + GH_TOKEN: ${{ secrets.GH_TOKEN }} + - name: Run build against action-next + uses: chromaui/action-next@latest + with: + buildScriptName: build-test-storybook + exitZeroOnChanges: true + forceRebuild: true + env: + LOG_LEVEL: debug + DEBUG: chromatic-cli + CHROMATIC_PROJECT_TOKEN: ${{ secrets.SMOKE_TESTS_CHROMATIC_PROJECT_TOKEN }} diff --git a/package.json b/package.json index e8570f9ef..20b21bb82 100644 --- a/package.json +++ b/package.json @@ -81,6 +81,7 @@ "lint:js": "cross-env NODE_ENV=production eslint --cache --cache-location=.cache/eslint --report-unused-disable-directives", "lint:package": "sort-package-json", "release": "./scripts/release.mjs", + "release-next": "./scripts/releaseNext.mjs", "prepack": "clean-package", "postpack": "clean-package restore", "publish-action": "./scripts/publishAction.mjs", diff --git a/scripts/releaseNext.mjs b/scripts/releaseNext.mjs new file mode 100755 index 000000000..845276599 --- /dev/null +++ b/scripts/releaseNext.mjs @@ -0,0 +1,39 @@ +#!/usr/bin/env node + +import { $ } from 'execa'; + +import { main as publishAction } from './publishAction.mjs'; + +async function main() { + const { stdout: status } = await $`git status --porcelain`; + if (status) { + console.error(`โ—๏ธ Working directory is not clean:\n${status}`); + return; + } + + await build(); + await publishAction('next'); +} + +async function build() { + const { stdout: nextVersion } = await $`auto shipit --dry-run --quiet`; + + console.info(`๐Ÿ“Œ Temporarily bumping version to '${nextVersion}' for build step`); + await $`npm --no-git-tag-version version ${nextVersion}`; + + console.info('๐Ÿ“ฆ Building with new version'); + await $({ + stdio: 'inherit', + env: { + ...process.env, + SENTRY_RELEASE: nextVersion, + }, + })`yarn build`; + + console.info('๐Ÿงน Resetting changes to let `auto` do its thing'); + await $`git reset --hard`; + + console.info('โœ… Build with new version completed, ready for auto!'); +} + +main(); From 9eeb9e01eda0234632e3dfd522bf15de4977ea04 Mon Sep 17 00:00:00 2001 From: Cody Kaup Date: Fri, 18 Oct 2024 10:01:28 -0500 Subject: [PATCH 3/3] Keep new version when pushing to action-next --- scripts/releaseNext.mjs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/scripts/releaseNext.mjs b/scripts/releaseNext.mjs index 845276599..78b6b9329 100755 --- a/scripts/releaseNext.mjs +++ b/scripts/releaseNext.mjs @@ -30,10 +30,7 @@ async function build() { }, })`yarn build`; - console.info('๐Ÿงน Resetting changes to let `auto` do its thing'); - await $`git reset --hard`; - - console.info('โœ… Build with new version completed, ready for auto!'); + console.info('โœ… Build with new version completed, ready for push to action-next!'); } main();