Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version on next: prerelease from 7.1.0-alpha.29 to 7.1.0-alpha.30 #22989

Merged
merged 207 commits into from
Jun 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
1cb81e8
sb-button web component: Added prefix slot in example
Sep 14, 2022
12b80b2
Updated tests for web components.
Sep 14, 2022
1f44525
Merge branch 'next' into pr/19183
shilman Oct 27, 2022
45d38a4
Merge branch 'next' into pr/19183
shilman Oct 31, 2022
175512e
Merge branch 'next' into sonntag-philipp/issues-19167-18858-custom-el…
ndelangen Jan 13, 2023
2254105
Merge branch 'next' into sonntag-philipp/issues-19167-18858-custom-el…
yannbf Apr 19, 2023
f2f8461
upgrade nx to support darwin-x64
chakAs3 May 8, 2023
89f4c36
Merge branch 'chaks/fix-sandbox-nx-deps' into chaks/source-decorator-…
chakAs3 May 11, 2023
7171464
Merge branch 'next' into chaks/source-decorator-feat-fix
chakAs3 May 11, 2023
f009e2a
rewrite the source decorator to generate proper source
chakAs3 May 11, 2023
e2fcba3
added source decorator unit tests
chakAs3 May 11, 2023
3250a86
add test story for source decorator
chakAs3 May 21, 2023
b6e5ec4
fix the bug after changing the render function
chakAs3 May 21, 2023
5cef4a4
fix type check
chakAs3 May 21, 2023
209b01e
Core: Improve MDX of error in story index
shilman May 25, 2023
838a0f4
Adds useSWC documentation
jonniebigodes May 31, 2023
9068e31
React decorators can conditionally render children
redbugz May 1, 2023
6822e4d
Use originalStoryFunction as that exists in all renderers
tmeasday May 29, 2023
cfeae71
Try and make decorator story more consistent
tmeasday May 30, 2023
213117b
Tweak story again
tmeasday Jun 1, 2023
8345c78
Merge branch 'next' into fix-hooks-rendered
redbugz Jun 1, 2023
01ab450
Move the new decorators stories to the right place
tmeasday Jun 2, 2023
96ac9b3
add a status api, and add tests
ndelangen Jun 2, 2023
1ce9b7f
Merge branch 'next' into chore_add_swc_feature_flag
jonniebigodes Jun 4, 2023
0880fae
Merge branch 'next' into norbert/status-api
ndelangen Jun 5, 2023
dbfb567
refine API to include presentation data and also custom data, do not …
ndelangen Jun 5, 2023
ca416af
ignore dep cycle
ndelangen Jun 5, 2023
010bbf5
feat: setup strict to true in tsconfig
efrenaragon96 May 4, 2023
f33f709
add(package.json): tiny-invariant lib
efrenaragon96 May 4, 2023
0044d9d
fix: ts errors in addon-measure
efrenaragon96 May 4, 2023
62e3a67
fix: ts errors from rebase with next branch
efrenaragon96 May 15, 2023
cb6818f
Use tiny-invariant over `as`
kasperpeulen May 31, 2023
6405e91
Merge branch 'next' into chaks/source-decorator-feat-fix
chakAs3 Jun 5, 2023
9545576
new line at the end
chakAs3 Jun 5, 2023
27c1b77
Merge branch 'next' into chaks/source-decorator-feat-fix
chakAs3 Jun 6, 2023
e560ec3
check e2e test working without anychange now
chakAs3 Jun 6, 2023
914286e
Revert "Docs: E2E tests for Source block update fix"
kasperpeulen Jun 6, 2023
6682cbb
Merge pull request #22934 from storybookjs/revert-22835-chaks/add-e2e…
kasperpeulen Jun 6, 2023
f1e7ec2
Merge branch 'next' into chaks/source-decorator-feat-fix
chakAs3 Jun 6, 2023
81f341a
mark as experimental
ndelangen Jun 6, 2023
08c35e3
Merge branch 'next' into norbert/status-api
ndelangen Jun 6, 2023
84181b2
Merge remote-tracking branch 'origin/next' into ts-migrate/addon-measure
kasperpeulen Jun 6, 2023
ef69f04
upgrade overlayscrollbars one way (has visual bugs)
ndelangen Jun 6, 2023
d2cb64f
switch to use react component, re-copy css into css-in-js
ndelangen Jun 6, 2023
85f723b
Add Vue2/3 issue to code comment
shilman Jun 7, 2023
265fea0
improvements
ndelangen Jun 7, 2023
a5cb092
add jsdoc
ndelangen Jun 7, 2023
c7e64a7
undo unintended change
ndelangen Jun 7, 2023
4bbe64d
upgrade webpack-dev-server, remove types package for it
ndelangen Jun 7, 2023
38b824f
upgrade wait-on
ndelangen Jun 7, 2023
7cfdd91
in scripts dir too
ndelangen Jun 7, 2023
f884519
upgrade open, better-opn, x-default-browser
ndelangen Jun 7, 2023
ced8bb7
Merge pull request #22890 from storybookjs/norbert/status-api
ndelangen Jun 7, 2023
3882f4d
fix the bundled dep needing util package
ndelangen Jun 7, 2023
d3fb916
slight downgrade, because the ESM is problematic 😲
ndelangen Jun 7, 2023
b2071a7
revert open upgrade entirely
ndelangen Jun 7, 2023
bcfd4e7
fix color
ndelangen Jun 7, 2023
32d2faf
Merge pull request #22948 from storybookjs/norbert/upgrade-scrollbars-v2
ndelangen Jun 7, 2023
0f4965c
silence compodoc when running storybook with --quiet
yannbf Jun 7, 2023
529afae
add release scripts
JReinhold Jun 7, 2023
67a4763
Merge pull request #22952 from storybookjs/norbert/upgrade/webpack-de…
ndelangen Jun 7, 2023
14efc57
add new scripts dependencies
JReinhold Jun 7, 2023
3c920f2
Merge pull request #22953 from storybookjs/norbert/upgrade-wait-on
ndelangen Jun 7, 2023
71bd67a
add github workflows
JReinhold Jun 7, 2023
d0e0ed2
remove temporary npm org
JReinhold Jun 7, 2023
8264a04
Merge pull request #22955 from storybookjs/norbert/upgrade-open
ndelangen Jun 7, 2023
635a6f8
add yarn configurations
JReinhold Jun 7, 2023
e1ca39a
add empty prerelease changelog
JReinhold Jun 7, 2023
92d4915
remove linear script remnants
ndelangen Jun 7, 2023
ae32c67
more scripts stuff
JReinhold Jun 7, 2023
572333f
update scripts lock file
JReinhold Jun 7, 2023
e186453
upgrade @rollup/pluginutils
ndelangen Jun 7, 2023
97b7f40
upgrade yaml
ndelangen Jun 7, 2023
5034d63
Merge pull request #22402 from efrenaragon96/ts-migrate/addon-measure
kasperpeulen Jun 7, 2023
5a7e9e2
use new release branch names
JReinhold Jun 7, 2023
b9efcc0
upgrade some webpack plugins
ndelangen Jun 7, 2023
c296501
Merge pull request #22960 from storybookjs/norbert/upgrade-rollup
ndelangen Jun 7, 2023
45a2eaf
Merge pull request #22961 from storybookjs/norbert/upgrade-yaml
ndelangen Jun 7, 2023
a90cdc4
Merge branch 'next' into norbert/remove-linear-remnants
ndelangen Jun 7, 2023
801c012
Merge pull request #22336 from redbugz/fix-hooks-rendered
shilman Jun 7, 2023
a6f4de3
Merge pull request #22861 from storybookjs/chore_add_swc_feature_flag
jonniebigodes Jun 7, 2023
a951917
Merge pull request #22957 from storybookjs/feat/silence-compodoc-on-q…
yannbf Jun 7, 2023
b047b0c
Merge pull request #22958 from storybookjs/norbert/remove-linear-remn…
ndelangen Jun 7, 2023
dafe63b
Merge pull request #22962 from storybookjs/norbert/upgrade-webpack-re…
ndelangen Jun 7, 2023
d3529cd
improve overlayscrollbars component
ndelangen Jun 7, 2023
7d91a67
add --open flag to angular binary
yannbf Jun 7, 2023
a6436a7
Merge pull request #22964 from storybookjs/fix/allow-open-flag-in-ang…
yannbf Jun 7, 2023
73bd3ce
Merge branch 'next' into norbert/cleanup-overlayscrollbars
ndelangen Jun 7, 2023
f9e26ba
Remove usage of <LinkWithVersion>
kylegach Jun 7, 2023
f66bca2
Removes typo
jonniebigodes Jun 7, 2023
1872214
Merge pull request #22966 from storybookjs/versioned-docs-links
kylegach Jun 7, 2023
5240cc8
modules/addons
ndelangen Jun 7, 2023
c470097
modules/channel
ndelangen Jun 7, 2023
308807b
modules/channel
ndelangen Jun 7, 2023
db1cd10
modules/globals
ndelangen Jun 7, 2023
4f216c2
modules/layout
ndelangen Jun 7, 2023
9fc2d12
modules/notifications
ndelangen Jun 7, 2023
e40ae7c
Merge pull request #22967 from storybookjs/chore_docs_babel_remove_ty…
jonniebigodes Jun 7, 2023
b1adfdb
simplify modules/provider
ndelangen Jun 7, 2023
3689047
modules/refs
ndelangen Jun 7, 2023
32dcb4d
modules/release-notes
ndelangen Jun 7, 2023
2de37c1
modules/settings
ndelangen Jun 7, 2023
15dfccf
modules/shortcuts
ndelangen Jun 7, 2023
22475d5
modules/stories
ndelangen Jun 7, 2023
a3b25cb
modules/url
ndelangen Jun 7, 2023
6c6cab0
modules/versions
ndelangen Jun 7, 2023
adf5051
Merge pull request #22963 from storybookjs/norbert/cleanup-overlayscr…
ndelangen Jun 7, 2023
e8c2f87
some upgrades
ndelangen Jun 7, 2023
df51bfb
Merge branch 'next' into norbert/upgrades-tools
ndelangen Jun 7, 2023
5493ba9
upgrade deps
ndelangen Jun 7, 2023
ea6e07c
sync versions of type-fest
ndelangen Jun 7, 2023
ec24911
Merge pull request #22782 from storybookjs/shilman/22619-improve-mdx-…
shilman Jun 8, 2023
cc15961
use current release branches
JReinhold Jun 8, 2023
01e52fd
fix typing issues, fix unit test, downgrade expect-type
ndelangen Jun 8, 2023
e8ef6bf
Merge branch 'next' of github.com:storybookjs/storybook into new-rele…
JReinhold Jun 8, 2023
f565d77
fix version test
JReinhold Jun 8, 2023
9e73ac1
swap isomorphic-unfetch for node-fetch
ndelangen Jun 8, 2023
ebf5cb6
considering node-fetch is ESM now, I'll prebundle it
ndelangen Jun 8, 2023
1a56b72
fix: Build manager adding multiple dashes to relative path
MarioCadenas Jun 8, 2023
0e7dfa2
make jest and typescript accept the node-fetch ESM edition
ndelangen Jun 8, 2023
d6a424b
Apply suggestions from code review
ndelangen Jun 8, 2023
ab5fcb8
Merge pull request #22969 from storybookjs/norbert/upgrades-tools
ndelangen Jun 8, 2023
95c0f86
Merge branch 'next' into norbert/add-jsdoc-manager-api
ndelangen Jun 8, 2023
f61c015
Merge branch 'next' into fix/build-manager-path-generation
MarioCadenas Jun 8, 2023
26d9db5
modules/hooks
ndelangen Jun 8, 2023
e9cbd69
modules/make-decorator
ndelangen Jun 8, 2023
126ed7f
modules/extra-hooks
ndelangen Jun 8, 2023
3e12815
modules/start
ndelangen Jun 8, 2023
bf6b009
Merge pull request #22968 from storybookjs/norbert/add-jsdoc-manager-api
ndelangen Jun 8, 2023
857dad7
regen lockfiles
ndelangen Jun 8, 2023
e3a54be
add patch picking
JReinhold Jun 8, 2023
c284093
Merge branch 'next' of github.com:storybookjs/storybook into new-rele…
JReinhold Jun 8, 2023
c6fe76d
fix dependency order
JReinhold Jun 8, 2023
6f0c2fc
Merge pull request #22518 from storybookjs/chaks/source-decorator-fea…
chakAs3 Jun 8, 2023
cfe01a1
Merge pull request #22975 from storybookjs/norbert/add-jsdoc-preview-api
ndelangen Jun 8, 2023
098c6a4
chore: Fixup
MarioCadenas Jun 8, 2023
4cf610a
Merge pull request #22976 from storybookjs/norbert/regen-lockfiles
ndelangen Jun 8, 2023
32b2a6f
upgrades of jest related packages
ndelangen Jun 8, 2023
75ba6b9
cleanup
ndelangen Jun 8, 2023
8b8b293
improve addon-interactions add url fallback
ndelangen Jun 8, 2023
7f1ffa7
Merge pull request #22974 from MarioCadenas/fix/build-manager-path-ge…
ndelangen Jun 8, 2023
68519b1
add the required polyfills so jest-mock doesn't cause angular to fail…
ndelangen Jun 8, 2023
5837e06
more picking fixes
JReinhold Jun 8, 2023
b319519
Merge branch 'next' of github.com:storybookjs/storybook into new-rele…
JReinhold Jun 8, 2023
8f20b58
Fix tests
kasperpeulen Jun 8, 2023
ccd5d5c
disable canary releasing
JReinhold Jun 8, 2023
5dd7c40
Merge branch 'new-release-tooling' of github.com:storybookjs/storyboo…
JReinhold Jun 8, 2023
7731b1f
fix branch names, enable discord notifications
JReinhold Jun 8, 2023
c213e68
Merge pull request #22959 from storybookjs/new-release-tooling
kasperpeulen Jun 8, 2023
4678e0c
Merge pull request #22979 from storybookjs/norbert/upgrade-jest
ndelangen Jun 8, 2023
9304c92
debug release tooling
kasperpeulen Jun 8, 2023
b02feb7
only consider commits on current branch when getting list of commits
JReinhold Jun 8, 2023
d43ebbf
install code deps to get correct lerna version
JReinhold Jun 8, 2023
4b05bc0
set max batch size to 10, disable discord alert for now
JReinhold Jun 8, 2023
4865a81
use debug branch
JReinhold Jun 8, 2023
78b2c2a
fix lint and prettier
JReinhold Jun 8, 2023
4edf949
fix lint
JReinhold Jun 8, 2023
e0cc694
cleanup branch names
JReinhold Jun 8, 2023
0ce1033
ignore even more commit messages
JReinhold Jun 8, 2023
9357516
Merge branch 'next' into next-debug
JReinhold Jun 8, 2023
ef7970d
remove next-debug branch
JReinhold Jun 8, 2023
5de81b1
downgrade ansi-regex
JReinhold Jun 8, 2023
f4b1734
Merge branch 'next-debug' of github.com:storybookjs/storybook into ne…
JReinhold Jun 8, 2023
1cf6332
remove yarn version plugin
JReinhold Jun 8, 2023
2d5e11a
Merge pull request #22990 from storybookjs/next-debug
JReinhold Jun 8, 2023
12572a8
new versioning strategy that doesnt use external tools
JReinhold Jun 8, 2023
2300ee3
code deps are not necessary anymore
JReinhold Jun 8, 2023
addfb99
Merge branch 'next' into pr/19183
shilman Jun 9, 2023
c725b46
Upgrade playwright to 1.35.0
shilman Jun 9, 2023
a45592b
remove shelljs use
ndelangen Jun 9, 2023
6c61c1b
Merge branch 'next' into norbert/remove-shelljs
ndelangen Jun 9, 2023
04102d1
fix type version conflict
ndelangen Jun 9, 2023
10e6a67
Merge pull request #22992 from storybookjs/shilman/upgrade-playwright
ndelangen Jun 9, 2023
88233c7
bump bench addon to canary to test fix
ndelangen Jun 9, 2023
a190290
now it should never happen again, should be no need to bump the bench…
ndelangen Jun 9, 2023
a72732b
fix tests, clenaup
JReinhold Jun 9, 2023
948bf3f
test workflow
JReinhold Jun 9, 2023
483bd65
Merge pull request #22996 from storybookjs/norbert/upgrade-addon-bench
ndelangen Jun 9, 2023
3b2901a
Merge branch 'next' into norbert/remove-shelljs
ndelangen Jun 9, 2023
b1f7904
don't use lerna
JReinhold Jun 9, 2023
2505a80
Merge branch 'next' into pr/19183
shilman Jun 9, 2023
7cdb0a8
run yarn task from root
JReinhold Jun 9, 2023
a843c4d
force add playwright packages
ndelangen Jun 9, 2023
ee7e0c3
try raw yarn install
JReinhold Jun 9, 2023
cad9303
install everything in CI
JReinhold Jun 9, 2023
1608464
include "Dependencies" as known label
JReinhold Jun 9, 2023
b784bf2
allow lock file updates in CI
JReinhold Jun 9, 2023
05b258d
revert workflow debugs
JReinhold Jun 9, 2023
c2d0f72
Merge branch 'next' into fix-release-publish
JReinhold Jun 9, 2023
ab6caf5
remove the 2 dependencies, but keep the resolution
ndelangen Jun 9, 2023
7ec2942
Merge pull request #22998 from storybookjs/norbert/playwright-fix
ndelangen Jun 9, 2023
1b04c74
Merge branch 'next' into norbert/remove-shelljs
ndelangen Jun 9, 2023
0bc5afc
Merge branch 'next' into pr/19183
shilman Jun 9, 2023
95e344a
Merge branch 'next' into fix-release-publish
JReinhold Jun 9, 2023
3205ba3
Merge pull request #22995 from storybookjs/norbert/remove-shelljs
ndelangen Jun 9, 2023
ade5322
Merge pull request #22997 from storybookjs/fix-release-publish
JReinhold Jun 9, 2023
db1e107
no concurrent danger runs, only run on PRs to next and main
JReinhold Jun 9, 2023
37170aa
Remove CODEOWNERS
JReinhold Jun 9, 2023
7e31563
only label patches in patch releases
JReinhold Jun 9, 2023
4fb6a28
use ref name for conditioning on patch vs prerelease
JReinhold Jun 9, 2023
cb2c311
Merge pull request #23002 from storybookjs/remove-codeowners
JReinhold Jun 9, 2023
9bd8aa4
Merge pull request #23001 from storybookjs/improve-danger
JReinhold Jun 9, 2023
29be327
Merge pull request #23003 from storybookjs/fix-publish-script
JReinhold Jun 9, 2023
e8389e5
don't reference prototype repo
JReinhold Jun 9, 2023
abfc677
Merge pull request #19183 from sonntag-philipp/sonntag-philipp/issues…
shilman Jun 9, 2023
502e01d
Merge pull request #23004 from storybookjs/minor-release-fixes
JReinhold Jun 9, 2023
c85e1de
Bump version from 7.1.0-alpha.29 to 7.1.0-alpha.30
github-actions[bot] Jun 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ executors:
default: 'small'
working_directory: /tmp/storybook
docker:
- image: mcr.microsoft.com/playwright:v1.34.3-focal
- image: mcr.microsoft.com/playwright:v1.35.0-focal
environment:
NODE_OPTIONS: --max_old_space_size=6144
resource_class: <<parameters.class>>
Expand Down
8 changes: 0 additions & 8 deletions .github/CODEOWNERS

This file was deleted.

88 changes: 88 additions & 0 deletions .github/workflows/canary-release-pr.WIP
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Publish canary release of PR
run-name: 'Canary release: PR #${{ github.event.pull_request.number }} at ${{ github.sha }}'

on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- next

env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

permissions:
pull-requests: write

jobs:
release-canary:
name: Release canary version
runs-on: ubuntu-latest
environment: canary-release
defaults:
run:
working-directory: scripts
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.yarn/berry/cache
key: yarn-v1-${{ hashFiles('scripts/yarn.lock') }}-${{ hashFiles('code/yarn.lock') }}
restore-keys: |
yarn-v1-${{ hashFiles('scripts/yarn.lock') }}-${{ hashFiles('code/yarn.lock') }}
yarn-v1-${{ hashFiles('scripts/yarn.lock') }}
yarn-v1

- name: Install dependencies
working-directory: .
run: yarn task --task=install --start-from=install

- name: Set version
id: version
run: |
SHORT_SHA=$(git rev-parse --short ${{ github.sha }})
yarn release:version --release-type prerelease --pre-id pr-${{ github.event.pull_request.number }}-$SHORT_SHA --verbose

- name: Publish v${{ steps.version.outputs.next-version }}
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn release:publish --tag pr-${{ github.event.pull_request.number }} --verbose

- name: Create comment on PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.pull_request.number }}\
--repo "${{github.repository }}"\
--body "🚀 This pull request has been published as version \`${{ steps.version.outputs.next-version }}\` and with the tag \`pr-${{ github.event.pull_request.number }}\`.
[You can see it on the npm registry here](https://npmjs.com/package/@storybook/cli/v/${{ steps.version.outputs.next-version }})".

- name: Create failing comment on PR
if: failure()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr comment ${{ github.event.pull_request.number }}\
--repo "${{github.repository }}"\
--body "Failed to publish canary version of this pul request. See the failed workflow run at See run at: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"

# - name: Report failure to Discord
# if: failure()
# env:
# DISCORD_WEBHOOK: ${{ secrets.DISCORD_MONITORING_URL }}
# uses: Ilshidur/action-discord@master
# with:
# args: 'The GitHub Action for publishing version ${{ steps.version.outputs.current-version }} (triggered by ${{ github.triggering_actor }}) failed! See run at: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
19 changes: 19 additions & 0 deletions .github/workflows/check-release-tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Check release tasks
run-name: 'Check tasks for "${{ github.event.pull_request.title }}" PR'

on:
pull_request:
types:
- opened
- edited
branches:
- 'latest-release'
- 'next-release'

jobs:
task-check:
runs-on: ubuntu-latest
steps:
- uses: chromaui/task-completed-checker-action@main
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
17 changes: 15 additions & 2 deletions .github/workflows/danger-js.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled
- edited
branches:
- main
- next

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

name: Danger JS
jobs:
Expand All @@ -13,7 +26,7 @@ jobs:
node-version: '16'
- uses: actions/checkout@v3
- name: Danger JS
uses: danger/danger-js@10.9.0
uses: danger/danger-js@11.2.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
175 changes: 175 additions & 0 deletions .github/workflows/prepare-patch-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
name: Prepare patch PR
run-name: Prepare patch PR, triggered by ${{ github.triggering_actor }}

on:
push:
branches:
- next
workflow_dispatch:

env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1

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

jobs:
prepare-patch-pull-request:
name: Prepare patch pull request
runs-on: ubuntu-latest
defaults:
run:
working-directory: scripts
steps:
- name: Checkout main
uses: actions/checkout@v3
with:
ref: main

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.yarn/berry/cache
key: yarn-v1-${{ hashFiles('scripts/yarn.lock') }}-${{ hashFiles('code/yarn.lock') }}
restore-keys: |
yarn-v1-${{ hashFiles('scripts/yarn.lock') }}-${{ hashFiles('code/yarn.lock') }}
yarn-v1-${{ hashFiles('scripts/yarn.lock') }}
yarn-v1

- name: Install Dependencies
working-directory: .
run: |
yarn task --task=install

- name: Check if pull request is frozen
if: github.event_name != 'workflow_dispatch'
id: check-frozen
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn release:is-pr-frozen

- name: Cancel when frozen
if: steps.check-frozen.outputs.frozen == 'true' && github.event_name != 'workflow_dispatch'
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: Check for unreleased changes
id: unreleased-changes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn release:unreleased-changes-exists --unpicked-patches

- name: Fetch next branch
run:
# depth needs to be set to a high enough number that it will contain all the merge commits to cherry-pick
# as of May 2023, the whole repo had 55K commits
git fetch --depth=2000 origin next

- name: Pick patches
id: pick-patches
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
yarn release:pick-patches

- name: Bump version
id: bump-version
if: steps.unreleased-changes.outputs.has-changes-to-release == 'true'
run: |
yarn release:version --release-type patch --verbose

# We need the current version to set the branch name, even when not bumping the version
- name: Get current version
id: current-version
if: steps.unreleased-changes.outputs.has-changes-to-release == 'false'
run: |
yarn release:get-current-version --verbose

- name: Set version output
id: versions
run: |
echo "current=${{ steps.bump-version.outputs.current-version || steps.current-version.outputs.current-version }}" >> "$GITHUB_OUTPUT"
echo "next=${{ steps.bump-version.outputs.next-version || steps.current-version.outputs.current-version }}" >> "$GITHUB_OUTPUT"

- name: Write changelog
if: steps.unreleased-changes.outputs.has-changes-to-release == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
yarn release:write-changelog ${{ steps.versions.outputs.next }} --unpicked-patches --verbose

- name: 'Commit changes to branch: version-patch-from-${{ steps.versions.outputs.current }}'
working-directory: .
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[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 push --force origin version-patch-from-${{ steps.versions.outputs.current }}

- name: Generate PR description
id: description
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn release:generate-pr-description --unpicked-patches --manual-cherry-picks='${{ steps.pick-patches.outputs.failed-cherry-picks }}' ${{ steps.unreleased-changes.outputs.has-changes-to-release == 'true' && format('{0}={1} {2}={3}', '--current-version', steps.versions.outputs.current, '--next-version', steps.versions.outputs.next) || '' }} --verbose

- name: Create or update pull request with release
if: steps.unreleased-changes.outputs.has-changes-to-release == 'true'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if PR_STATE=$(gh pr view --json state --jq .state 2>/dev/null) && [[ -n "$PR_STATE" && "$PR_STATE" == *"OPEN"* ]]; then
gh pr edit \
--repo "${{github.repository }}" \
--title "Bump version on \`main\`: patch from ${{ steps.versions.outputs.current }} to ${{ steps.versions.outputs.next }}" \
--body "${{ steps.description.outputs.description }}"
else
gh pr create \
--repo "${{github.repository }}" \
--title "Bump version on \`main\`: patch from ${{ steps.versions.outputs.current }} to ${{ steps.versions.outputs.next }}" \
--base latest-release \
--head version-patch-from-${{ steps.versions.outputs.current }} \
--body "${{ steps.description.outputs.description }}"
fi

- name: Create or update pull request without release
if: steps.unreleased-changes.outputs.has-changes-to-release == 'false'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if PR_STATE=$(gh pr view --json state --jq .state 2>/dev/null) && [[ -n "$PR_STATE" && "$PR_STATE" == *"OPEN"* ]]; then
gh pr edit \
--repo "${{github.repository }}"\
--title "Merge patches to \`main\`" \
--body "${{ steps.description.outputs.description }}"
else
gh pr create \
--repo "${{github.repository }}"\
--title "Merge patches to \`main\`" \
--base latest-release \
--head version-patch-from-${{ steps.versions.outputs.current }} \
--body "${{ steps.description.outputs.description }}"
fi

- name: Report job failure to Discord
if: failure()
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_MONITORING_URL }}
uses: Ilshidur/action-discord@master
with:
args: 'The GitHub Action for preparing the release pull request bumping from v${{ steps.versions.outputs.current }} to v${{ steps.versions.outputs.next }} (triggered by ${{ github.triggering_actor }}) failed! See run at: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
Loading