-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
351 changed files
with
8,207 additions
and
5,362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/**/.yarn/** linguist-generated | ||
* -text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Generate and push sandboxes | ||
name: Generate and push sandboxes (main) | ||
|
||
on: | ||
schedule: | ||
|
@@ -10,74 +10,48 @@ on: | |
# branches: | ||
# - <your-branch-name> | ||
# 2. change the "ref" value to <your-branch-name> in the actions/checkout step below. | ||
# 3. 👉 DON'T FORGET TO UNDO THE VALUES BACK BEFORE YOU MERGE YOUR CHANGES! | ||
# 3. 👉 DON'T FORGET TO UNDO THE VALUES BACK TO `main` BEFORE YOU MERGE YOUR CHANGES! | ||
|
||
jobs: | ||
generate: | ||
runs-on: ubuntu-latest | ||
env: | ||
YARN_ENABLE_IMMUTABLE_INSTALLS: false | ||
CLEANUP_SANDBOX_NODE_MODULES: true | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node_version: | ||
- 16 | ||
- 18 | ||
branch: | ||
- main | ||
- next | ||
include: | ||
- node_version: 16 | ||
# space-delimited list of templates | ||
exclude: 'angular-cli/prerelease' | ||
- node_version: 18 | ||
# space-delimited list of templates | ||
templates: 'angular-cli/prerelease' | ||
steps: | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node_version }} | ||
|
||
node-version: 16 | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ matrix.branch }} | ||
|
||
ref: main | ||
- name: Setup git user | ||
run: | | ||
git config --global user.name "Storybook Bot" | ||
git config --global user.email "[email protected]" | ||
- name: Install dependencies | ||
run: node ./scripts/check-dependencies.js | ||
|
||
- name: Compile Storybook libraries | ||
run: yarn task --task compile --start-from=auto --no-link | ||
|
||
- name: Publishing to local registry | ||
run: yarn local-registry --publish | ||
working-directory: ./code | ||
|
||
- name: Running local registry | ||
run: yarn local-registry --open & | ||
working-directory: ./code | ||
|
||
- name: Wait for registry | ||
run: yarn wait-on http://localhost:6001 | ||
working-directory: ./code | ||
|
||
- name: Generate | ||
run: yarn generate-sandboxes --local-registry --templates ${{matrix.templates}} --exclude ${{matrix.exclude}} | ||
run: yarn generate-sandboxes --local-registry --exclude=angular-cli/prerelease | ||
working-directory: ./code | ||
|
||
- name: Publish | ||
run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT}}@github.com/storybookjs/sandboxes.git --push --branch=${{ matrix.branch }} | ||
run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT}}@github.com/storybookjs/sandboxes.git --push --branch=main | ||
working-directory: ./code | ||
|
||
- name: The job has failed | ||
if: ${{ failure() || cancelled() }} | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_MONITORING_URL }} | ||
uses: Ilshidur/action-discord@master | ||
with: | ||
args: 'The generation of sandboxes with Node version **${{ matrix.node_version }}** in the **${{ matrix.branch }}** branch has failed. [View Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})' | ||
args: 'The generation of sandboxes in the **main** branch has failed. [View Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Generate and push sandboxes (next) | ||
|
||
on: | ||
schedule: | ||
- cron: '2 2 */1 * *' | ||
workflow_dispatch: | ||
# To test fixes on push rather than wait for the scheduling, do the following: | ||
# 1. Uncomment the lines below and add your branch. | ||
# push: | ||
# branches: | ||
# - <your-branch-name> | ||
# 2. change the "ref" value to <your-branch-name> in the actions/checkout step below. | ||
# 3. 👉 DON'T FORGET TO UNDO THE VALUES BACK TO `next` BEFORE YOU MERGE YOUR CHANGES! | ||
|
||
jobs: | ||
generate: | ||
runs-on: ubuntu-latest | ||
env: | ||
YARN_ENABLE_IMMUTABLE_INSTALLS: false | ||
CLEANUP_SANDBOX_NODE_MODULES: true | ||
steps: | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: next | ||
- name: Setup git user | ||
run: | | ||
git config --global user.name "Storybook Bot" | ||
git config --global user.email "[email protected]" | ||
- name: Install dependencies | ||
run: node ./scripts/check-dependencies.js | ||
- name: Compile Storybook libraries | ||
run: yarn task --task compile --start-from=auto --no-link | ||
- name: Publishing to local registry | ||
run: yarn local-registry --publish | ||
working-directory: ./code | ||
- name: Running local registry | ||
run: yarn local-registry --open & | ||
working-directory: ./code | ||
- name: Wait for registry | ||
run: yarn wait-on http://localhost:6001 | ||
working-directory: ./code | ||
- name: Generate | ||
run: yarn generate-sandboxes --local-registry --exclude=angular-cli/prerelease --debug | ||
working-directory: ./code | ||
- name: Publish | ||
run: yarn publish-sandboxes --remote=https://storybook-bot:${{ secrets.PAT_STORYBOOK_BOT}}@github.com/storybookjs/sandboxes.git --push --branch=next | ||
working-directory: ./code | ||
- name: The job has failed | ||
if: ${{ failure() || cancelled() }} | ||
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_MONITORING_URL }} | ||
uses: Ilshidur/action-discord@master | ||
with: | ||
args: 'The generation of sandboxes in the **next** branch has failed. [View Run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: Prepare prerelease PR | ||
run-name: Prepare prerelease PR, triggered by ${{ github.triggering_actor }} | ||
name: Prepare non-patch PR | ||
run-name: Prepare non-patch PR, triggered by ${{ github.triggering_actor }} | ||
|
||
on: | ||
push: | ||
|
@@ -34,8 +34,8 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
prepare-prerelease-pull-request: | ||
name: Prepare prerelease pull request | ||
prepare-non-patch-pull-request: | ||
name: Prepare non-patch pull request | ||
runs-on: ubuntu-latest | ||
environment: release | ||
defaults: | ||
|
@@ -112,21 +112,37 @@ jobs: | |
run: | | ||
yarn release:version --deferred --release-type ${{ inputs.release-type || 'prerelease' }} ${{ inputs.pre-id && format('{0} {1}', '--pre-id', inputs.pre-id) || '' }} --verbose | ||
- name: Check release vs prerelease | ||
id: is-prerelease | ||
run: yarn release:is-prerelease | ||
|
||
- name: Write changelog | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
yarn release:write-changelog ${{ steps.bump-version.outputs.next-version }} --verbose | ||
- name: 'Commit changes to branch: version-prerelease-from-${{ steps.bump-version.outputs.current-version }}' | ||
- name: 'Commit changes to branch: version-non-patch-from-${{ steps.bump-version.outputs.current-version }}' | ||
working-directory: . | ||
run: | | ||
git config --global user.name 'storybook-bot' | ||
git config --global user.email '[email protected]' | ||
git checkout -b version-prerelease-from-${{ steps.bump-version.outputs.current-version }} | ||
git checkout -b version-non-patch-from-${{ steps.bump-version.outputs.current-version }} | ||
git add . | ||
git commit -m "Write changelog for ${{ steps.bump-version.outputs.next-version }} [skip ci]" || true | ||
git push --force origin version-non-patch-from-${{ steps.bump-version.outputs.current-version }} | ||
- name: Resolve merge-conflicts with base branch | ||
if: steps.is-prerelease.outputs.prerelease == 'false' | ||
working-directory: . | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config pull.rebase false | ||
git pull --no-commit --no-ff origin latest-release || true | ||
git checkout --ours . | ||
git add . | ||
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 }} | ||
git commit --no-verify -m "Merge latest-release into version-non-patch-from-${{ steps.bump-version.outputs.current-version }} with conflicts resolved to ours [skip ci]" | ||
- name: Generate PR description | ||
id: description | ||
|
@@ -144,14 +160,15 @@ jobs: | |
gh pr edit \ | ||
--repo "${{github.repository }}" \ | ||
--title "Release: $CAPITALIZED_RELEASE_TYPE ${{ inputs.pre-id && format('{0} ', inputs.pre-id) }}${{ steps.bump-version.outputs.next-version }}" \ | ||
--base ${{ steps.is-prerelease.outputs.prerelease == 'true' && 'next-release' || 'latest-release' }} \ | ||
--body "${{ steps.description.outputs.description }}" | ||
else | ||
gh pr create \ | ||
--repo "${{github.repository }}"\ | ||
--title "Release: $CAPITALIZED_RELEASE_TYPE ${{ inputs.pre-id && format('{0} ', inputs.pre-id) }}${{ steps.bump-version.outputs.next-version }}" \ | ||
--label "release" \ | ||
--base next-release \ | ||
--head version-prerelease-from-${{ steps.bump-version.outputs.current-version }} \ | ||
--base ${{ steps.is-prerelease.outputs.prerelease == 'true' && 'next-release' || 'latest-release' }} \ | ||
--head version-non-patch-from-${{ steps.bump-version.outputs.current-version }} \ | ||
--body "${{ steps.description.outputs.description }}" | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,15 @@ jobs: | |
git config --global user.email '[email protected]' | ||
yarn release:pick-patches | ||
- name: Cancel when no patches to pick | ||
if: steps.pick-patches.outputs.pr-count == '0' && steps.pick-patches.outputs.pr-count != null | ||
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: Bump version deferred | ||
id: bump-version | ||
if: steps.unreleased-changes.outputs.has-changes-to-release == 'true' | ||
|
@@ -121,7 +130,7 @@ jobs: | |
git config --global user.email '[email protected]' | ||
git checkout -b version-patch-from-${{ steps.versions.outputs.current }} | ||
git add . | ||
git commit -m "Write changelog for ${{ steps.versions.outputs.next }}" || true | ||
git commit -m "Write changelog for ${{ steps.versions.outputs.next }} [skip ci]" || true | ||
git push --force origin version-patch-from-${{ steps.versions.outputs.current }} | ||
- name: Generate PR description | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.