Skip to content

Commit

Permalink
Merge pull request #23414 from storybookjs/version-prerelease-from-7.…
Browse files Browse the repository at this point in the history
…1.0-rc.1

Release: Prerelease 7.1.0-rc.2
  • Loading branch information
shilman authored Jul 13, 2023
2 parents 5b32421 + 4124e95 commit c1b4e2e
Show file tree
Hide file tree
Showing 38 changed files with 1,488 additions and 1,105 deletions.
65 changes: 6 additions & 59 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ parameters:
workflow:
description: Which workflow to run
type: enum
enum: ['ci', 'pr', 'merged', 'daily']
default: 'ci'
enum: ['normal', 'merged', 'daily', 'skipped']
default: 'skipped'

executors:
sb_node_16_classic:
Expand Down Expand Up @@ -43,7 +43,7 @@ executors:
default: 'small'
working_directory: /tmp/storybook
docker:
- image: mcr.microsoft.com/playwright:v1.35.0-focal
- image: mcr.microsoft.com/playwright:v1.36.0-focal
environment:
NODE_OPTIONS: --max_old_space_size=6144
resource_class: <<parameters.class>>
Expand Down Expand Up @@ -257,7 +257,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_node_16_browsers
Expand All @@ -282,7 +281,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_node_16_browsers
Expand All @@ -303,7 +301,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: large
name: sb_node_16_browsers
Expand Down Expand Up @@ -338,7 +335,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_playwright
Expand All @@ -359,7 +355,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: large
name: sb_playwright
Expand All @@ -380,7 +375,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_node_16_browsers
Expand All @@ -400,7 +394,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_playwright
Expand All @@ -424,7 +417,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_playwright
Expand All @@ -448,7 +440,6 @@ jobs:
parameters:
parallelism:
type: integer
default: 2
executor:
class: medium
name: sb_playwright
Expand All @@ -468,54 +459,9 @@ jobs:
template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task bench)

workflows:
ci:
normal:
when:
and:
- equal: [api, << pipeline.trigger_source >>]
- equal: [ci, << pipeline.parameters.workflow >>]
jobs:
- pretty-docs
- build
- lint:
requires:
- build
- check:
requires:
- build
- unit-tests:
requires:
- build
- script-unit-tests:
requires:
- build
- chromatic-internal-storybooks:
requires:
- build
- create-sandboxes:
requires:
- build
- build-sandboxes:
requires:
- create-sandboxes
- chromatic-sandboxes:
requires:
- build-sandboxes
- e2e-production:
requires:
- build-sandboxes
- e2e-dev:
requires:
- create-sandboxes
- test-runner-production:
requires:
- build-sandboxes
# TODO: reenable once we find out the source of flakyness
# - test-runner-dev:
# requires:
# - create-sandboxes
pr:
when:
equal: [pr, << pipeline.parameters.workflow >>]
equal: [normal, << pipeline.parameters.workflow >>]
jobs:
- pretty-docs
- build
Expand Down Expand Up @@ -554,6 +500,7 @@ workflows:
requires:
- build-sandboxes
- e2e-dev:
parallelism: 2
requires:
- create-sandboxes
- test-runner-production:
Expand Down
3 changes: 1 addition & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ Closes #

#### Maintainers

- [ ] If this PR should be tested against many or all sandboxes,
make sure to add the `ci:merged` or `ci:daily` GH label to it.
- [ ] When this PR is ready for testing, make sure to add `ci:normal`, `ci:merged` or `ci:daily` GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in `code/lib/cli/src/sandbox-templates.ts`
- [ ] Make sure this PR contains **one** of the labels below.

`["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]`
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/prepare-patch-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ jobs:
git config --global user.email '32066757+storybook-bot@users.noreply.github.com'
yarn release:pick-patches
- name: Bump version
- name: Bump version deferred
id: bump-version
if: steps.unreleased-changes.outputs.has-changes-to-release == 'true'
run: |
yarn release:version --release-type patch --verbose
yarn release:version --deferred --release-type patch --verbose
# We need the current version to set the branch name, even when not bumping the version
- name: Get current version
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
git config --global user.email '32066757+storybook-bot@users.noreply.github.com'
git checkout -b version-patch-from-${{ steps.versions.outputs.current }}
git add .
git commit -m "Bump version from ${{ steps.versions.outputs.current }} to ${{ steps.versions.outputs.next }}" || true
git commit -m "Write changelog for ${{ steps.versions.outputs.next }}" || true
git push --force origin version-patch-from-${{ steps.versions.outputs.current }}
- name: Generate PR description
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/prepare-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ jobs:
gh run cancel ${{ github.run_id }}
gh run watch ${{ github.run_id }}
- name: Bump version
- name: Bump version deferred
id: bump-version
run: |
yarn release:version --release-type ${{ inputs.release-type || 'prerelease' }} ${{ inputs.pre-id && format('{0} {1}', '--pre-id', inputs.pre-id) || '' }} --verbose
yarn release:version --deferred --release-type ${{ inputs.release-type || 'prerelease' }} ${{ inputs.pre-id && format('{0} {1}', '--pre-id', inputs.pre-id) || '' }} --verbose
- name: Write changelog
env:
Expand All @@ -125,7 +125,7 @@ jobs:
git config --global user.email '32066757+storybook-bot@users.noreply.github.com'
git checkout -b version-prerelease-from-${{ steps.bump-version.outputs.current-version }}
git add .
git commit -m "Bump version from ${{ steps.bump-version.outputs.current-version }} to ${{ steps.bump-version.outputs.next-version }}" || true
git commit -m "Write changelog for ${{ steps.bump-version.outputs.next-version }}" || true
git push --force origin version-prerelease-from-${{ steps.bump-version.outputs.current-version }}
- name: Generate PR description
Expand Down
32 changes: 31 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ jobs:
run:
working-directory: scripts
steps:
- name: Cancel if [skip ci]
if: contains(github.event.head_commit.message, '[skip ci]')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# From https://stackoverflow.com/a/75809743
run: |
gh run cancel ${{ github.run_id }}
gh run watch ${{ github.run_id }}
- name: Checkout ${{ github.ref_name }}
uses: actions/checkout@v3
with:
Expand All @@ -53,6 +62,27 @@ jobs:
run: |
yarn install
- name: Apply deferred version bump and commit
id: version-bump
working-directory: .
run: |
CURRENT_VERSION=$(cat ./code/package.json | jq '.version')
DEFERRED_NEXT_VERSION=$(cat ./code/package.json | jq '.deferredNextVersion')
if [[ "$DEFERRED_NEXT_VERSION" == "null" ]]; then
echo "No deferred version set, not bumping versions"
exit 0
fi
cd scripts
yarn release:version --apply --verbose
cd ..
git config --global user.name "storybook-bot"
git config --global user.email "32066757+storybook-bot@users.noreply.github.com"
git add .
git commit -m "Bump version from $CURRENT_VERSION to $DEFERRED_NEXT_VERSION [skip ci]" || true
git push origin ${{ github.ref_name }}
- name: Get current version
id: version
run: yarn release:get-current-version
Expand Down Expand Up @@ -128,7 +158,7 @@ jobs:
git pull
git checkout origin/main ./CHANGELOG.md
git add ./CHANGELOG.md
git commit -m "Update CHANGELOG.md for v${{ steps.version.outputs.current-version }}"
git commit -m "Update CHANGELOG.md for v${{ steps.version.outputs.current-version }} [skip ci]"
git push origin next
- name: Sync versions/next.json from `next` to `main`
Expand Down
33 changes: 9 additions & 24 deletions .github/workflows/trigger-circle-ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
- next
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
get-branch:
runs-on: ubuntu-latest
Expand All @@ -32,39 +36,20 @@ jobs:
outputs:
branch: ${{ env.branch }}

trigger-ci-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'pull_request_target' && github.event.pull_request.draft == true && !contains(github.event.pull_request.labels.*.name, 'ci:pr') && !contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily')
steps:
- name: Trigger draft PR tests
run: >
curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \
-H "Content-Type: application/json" \
-H "Circle-Token: $CIRCLE_CI_TOKEN" \
-d '{
"branch": "'"$BRANCH"'",
"parameters": {
"workflow": "ci"
}
}'
env:
CIRCLE_CI_TOKEN: ${{ secrets.CIRCLE_CI_TOKEN }}
BRANCH: ${{ needs.get-branch.outputs.branch }}
trigger-pr-tests:
trigger-normal-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'pull_request_target' && (((github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'release')) || contains(github.event.pull_request.labels.*.name, 'ci:pr')) && !contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily'))
if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:normal')
steps:
- name: Trigger PR tests
- name: Trigger Normal tests
run: >
curl -X POST --location "https://circleci.com/api/v2/project/gh/storybookjs/storybook/pipeline" \
-H "Content-Type: application/json" \
-H "Circle-Token: $CIRCLE_CI_TOKEN" \
-d '{
"branch": "'"$BRANCH"'",
"parameters": {
"workflow": "pr"
"workflow": "normal"
}
}'
env:
Expand All @@ -73,7 +58,7 @@ jobs:
trigger-merged-tests:
runs-on: ubuntu-latest
needs: get-branch
if: github.event_name == 'push' || (contains(github.event.pull_request.labels.*.name, 'ci:merged') && !contains(github.event.pull_request.labels.*.name, 'ci:daily'))
if: github.event_name == 'push' || contains(github.event.pull_request.labels.*.name, 'ci:merged')
steps:
- name: Trigger merged tests
run: >
Expand Down
Loading

0 comments on commit c1b4e2e

Please sign in to comment.