From 89d8603dce72069952661fe5232fec2c50df5e42 Mon Sep 17 00:00:00 2001 From: Ben Elan Date: Fri, 3 Nov 2023 16:37:03 -0700 Subject: [PATCH] ci: update github actions for new rc base branch --- .../{chromatic.yml => chromatic-main.yml} | 2 +- .github/workflows/chromatic-rc.yml | 44 +++++++++++++++++++ .github/workflows/codeql-analysis.yml | 4 +- .github/workflows/pr-bot.yml | 2 +- .github/workflows/pr-e2e.yml | 2 +- .github/workflows/pr-milestone.yml | 2 +- ...tests_eslint-plugin-calcite-components.yml | 12 ++--- package.json | 2 + 8 files changed, 56 insertions(+), 14 deletions(-) rename .github/workflows/{chromatic.yml => chromatic-main.yml} (98%) create mode 100644 .github/workflows/chromatic-rc.yml diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic-main.yml similarity index 98% rename from .github/workflows/chromatic.yml rename to .github/workflows/chromatic-main.yml index 0d6924e18d0..d31c351e385 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic-main.yml @@ -1,4 +1,4 @@ -name: "Chromatic" +name: "Chromatic - Main" on: push: branches: [main] diff --git a/.github/workflows/chromatic-rc.yml b/.github/workflows/chromatic-rc.yml new file mode 100644 index 00000000000..932c943222f --- /dev/null +++ b/.github/workflows/chromatic-rc.yml @@ -0,0 +1,44 @@ +name: "Chromatic - RC" +on: + push: + branches: [rc] + pull_request: + branches: [rc] + types: [labeled, synchronize] +jobs: + run: + if: | + (github.event.action == 'labeled' && github.event.label.name == 'pr ready for visual snapshots') || github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version-file: package.json + - run: npm install + - run: npm --workspace="packages/calcite-design-tokens" run build + - name: Publish to Chromatic + uses: chromaui/action@v1 + with: + projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }} + zip: true + exitOnceUploaded: true + autoAcceptChanges: rc + workingDir: packages/calcite-components + env: + STORYBOOK_SCREENSHOT_TEST_BUILD: true + CHROMATIC_DIFF_THRESHOLD: ${{ secrets.CHROMATIC_DIFF_THRESHOLD }} + skip: + if: contains(github.event.pull_request.labels.*.name, 'skip visual snapshots') + runs-on: ubuntu-latest + steps: + - name: Skip Chromatic + uses: Sibz/github-status-action@v1 + with: + authToken: ${{ secrets.GITHUB_TOKEN }} + context: UI Tests + description: Chromatic run skipped + state: success + sha: ${{github.event.pull_request.head.sha || github.sha}} diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5338fe16b12..1ab6b17213b 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,10 +13,10 @@ name: "CodeQL" on: push: - branches: [main] + branches: [main, rc] pull_request: # The branches below must be a subset of the branches above - branches: [main] + branches: [main, rc] schedule: - cron: "19 2 * * 4" diff --git a/.github/workflows/pr-bot.yml b/.github/workflows/pr-bot.yml index d0ada3932eb..67987522799 100644 --- a/.github/workflows/pr-bot.yml +++ b/.github/workflows/pr-bot.yml @@ -1,7 +1,7 @@ name: PR Bot on: pull_request: - branches: [main] + branches: [main, rc] permissions: pull-requests: write issues: write diff --git a/.github/workflows/pr-e2e.yml b/.github/workflows/pr-e2e.yml index ee89becc64b..9b7fedafef5 100644 --- a/.github/workflows/pr-e2e.yml +++ b/.github/workflows/pr-e2e.yml @@ -1,7 +1,7 @@ name: E2E on: pull_request: - branches: [main] + branches: [main, rc] jobs: e2e: runs-on: ubuntu-20.04 diff --git a/.github/workflows/pr-milestone.yml b/.github/workflows/pr-milestone.yml index 7974b81e6a7..3e610eec9ec 100644 --- a/.github/workflows/pr-milestone.yml +++ b/.github/workflows/pr-milestone.yml @@ -1,7 +1,7 @@ name: PR Merged on: pull_request: - branches: [main] + branches: [main, rc] types: [closed] jobs: milestone: diff --git a/.github/workflows/pr-tests_eslint-plugin-calcite-components.yml b/.github/workflows/pr-tests_eslint-plugin-calcite-components.yml index 38d39b9c3dc..124f4e63451 100644 --- a/.github/workflows/pr-tests_eslint-plugin-calcite-components.yml +++ b/.github/workflows/pr-tests_eslint-plugin-calcite-components.yml @@ -2,15 +2,11 @@ name: Run eslint-plugin-calcite-components tests on: pull_request: - paths: - - "packages/eslint-plugin-calcite-components/**" - branches: - - master + paths: ["packages/eslint-plugin-calcite-components/**"] + branches: [main, rc] push: - paths: - - "packages/eslint-plugin-calcite-components/**" - branches: - - master + paths: ["packages/eslint-plugin-calcite-components/**"] + branches: [main, rc] jobs: build: diff --git a/package.json b/package.json index 6c235206e02..c7f27052b78 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,10 @@ "clean": "turbo run clean --log-order=stream && rimraf node_modules", "lint": "turbo run lint --log-order=stream", "publish:next": "lerna publish from-package --dist-tag next --yes", + "publish:rc": "lerna publish from-package --dist-tag rc --yes", "publish:latest": "lerna publish from-package --yes", "version:next": "lerna version --conventional-prerelease --preid next --no-git-tag-version --no-push --yes && npm run util:sync-linked-package-versions", + "version:rc": "lerna version --conventional-prerelease --preid rc --no-git-tag-version --no-push --yes && npm run util:sync-linked-package-versions", "version:latest": "lerna version --conventional-commits --create-release github --no-git-tag-version --no-push --yes && npm run util:sync-linked-package-versions", "prepare": "husky install", "preversion": "npm run util:is-in-sync-with-origin && npm run util:is-working-tree-clean",