forked from storybookjs/storybook
-
Notifications
You must be signed in to change notification settings - Fork 0
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
2,165 changed files
with
40,466 additions
and
81,258 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
5 changes: 1 addition & 4 deletions
5
.github/ISSUE_TEMPLATE/feature_request.yml → .github/DISCUSSION_TEMPLATE/ideas.yml
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
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
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,33 @@ | ||
name: Publish canary release of PR | ||
run-name: 'Canary release: PR #${{ inputs.pr }}, triggered by ${{ github.triggering_actor }}' | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
pr: | ||
description: 'Which pull request number to create a canary release for' | ||
required: true | ||
type: number | ||
|
||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ inputs.pr }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
release-canary: | ||
name: Release canary version | ||
runs-on: ubuntu-latest | ||
environment: release | ||
defaults: | ||
run: | ||
working-directory: scripts | ||
steps: | ||
- name: Do nothing | ||
run: echo "I'm not doing anything" |
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 |
---|---|---|
@@ -0,0 +1,179 @@ | ||
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 | ||
environment: release | ||
defaults: | ||
run: | ||
working-directory: scripts | ||
steps: | ||
- name: Checkout main | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: main | ||
token: ${{ secrets.GH_TOKEN }} | ||
|
||
- 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 --patch | ||
|
||
- 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 'storybook-bot' | ||
git config --global user.email '[email protected]' | ||
yarn release:pick-patches | ||
- name: Bump version deferred | ||
id: bump-version | ||
if: steps.unreleased-changes.outputs.has-changes-to-release == 'true' | ||
run: | | ||
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 | ||
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 'storybook-bot' | ||
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 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 "Release: Patch ${{ steps.versions.outputs.next }}" \ | ||
--body "${{ steps.description.outputs.description }}" | ||
else | ||
gh pr create \ | ||
--repo "${{github.repository }}" \ | ||
--title "Release: Patch ${{ steps.versions.outputs.next }}" \ | ||
--label "release" \ | ||
--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 "Release: Merge patches to \`main\` (without version bump)" \ | ||
--body "${{ steps.description.outputs.description }}" | ||
else | ||
gh pr create \ | ||
--repo "${{github.repository }}"\ | ||
--title "Release: Merge patches to \`main\` (without version bump)" \ | ||
--label "release" \ | ||
--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 }}' |
Oops, something went wrong.