Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7c688fb

Browse files
authored
Release workflow for stable releases (#5476)
**What's the problem this PR addresses?** I'm currently the only one who can release stable releases. **How did you fix it?** This manual workflow does the same thing I do on my laptop, so it should theoretically work. **Checklist** <!--- Don't worry if you miss something, chores are automatically tested. --> <!--- This checklist exists to help you remember doing the chores when you submit a PR. --> <!--- Put an `x` in all the boxes that apply. --> - [x] I have read the [Contributing Guide](https://yarnpkg.com/advanced/contributing). <!-- See https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released for more details. --> <!-- Check with `yarn version check` and fix with `yarn version check -i` --> - [x] I have set the packages that need to be released for my changes to be effective. <!-- The "Testing chores" workflow validates that your PR follows our guidelines. --> <!-- If it doesn't pass, click on it to see details as to what your PR might be missing. --> - [x] I will check that all automated PR checks pass before the PR gets reviewed.
1 parent 60f9c19 commit 7c688fb

File tree

2 files changed

+72
-0
lines changed

2 files changed

+72
-0
lines changed

‎.github/workflows/release-branch.yml‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
branch:
5+
description: 'Branch?'
6+
required: true
7+
default: 'cherry-pick/'
8+
9+
name: 'Release Branch'
10+
jobs:
11+
release:
12+
name: 'Releasing a Patch Version'
13+
runs-on: ubuntu-latest
14+
15+
env:
16+
NODE_OPTIONS: --max_old_space_size=8192
17+
18+
steps:
19+
- uses: actions/checkout@v3
20+
with:
21+
ref: ${{github.event.inputs.branch}}
22+
token: ${{secrets.YARNBOT_TOKEN}}
23+
24+
- name: 'Retrieve all the relevant tags'
25+
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
26+
27+
- name: 'Use Node.js 18.x'
28+
uses: actions/setup-node@v3
29+
with:
30+
node-version: 18.x
31+
32+
- name: 'Build a binary for convenience'
33+
run: |
34+
yarn build:cli
35+
36+
TMPBIN=$(mktemp -d)
37+
cp ./packages/yarnpkg-cli/bundles/yarn.js $TMPBIN/yarn.js
38+
39+
grep -v "yarnPath:" .yarnrc.yml > $TMPBIN/.yarnrc.yml
40+
cp $TMPBIN/.yarnrc.yml .yarnrc.yml
41+
echo "yarnPath: '$TMPBIN/yarn.js'" >> .yarnrc.yml
42+
git update-index --skip-worktree -- .yarnrc.yml
43+
44+
- name: 'Generate the release commits'
45+
run: |
46+
git config user.name "Yarn Bot"
47+
git config user.email nison.mael+yarnbot@gmail.com
48+
./scripts/release/01-release-tags.sh
49+
git push --follow-tags
50+
51+
- name: 'Upload the releases'
52+
run: |
53+
yarn config set -H 'npmAuthToken' "${{secrets.YARNBOT_NPM_TOKEN}}"
54+
yarn config set -H 'npmRegistries["//npm.pkg.github.com"].npmAuthToken' "${{secrets.YARNBOT_TOKEN}}"
55+
./scripts/release/02-release-builds.sh
56+
./scripts/release/03-release-npm.sh
57+
58+
- name: 'Updates the stableVersion field'
59+
run: |
60+
RELEASE_COMMIT=$(git rev-parse HEAD)
61+
node ./scripts/stable-versions-store.js
62+
git checkout master
63+
node ./scripts/stable-versions-restore.js
64+
HEAD_COMMIT=$(git rev-parse HEAD)
65+
66+
git reset --soft $HEAD_COMMIT
67+
git checkout $RELEASE_COMMIT -- packages/*/bin/**
68+
git add .
69+
git commit -m 'Sync master with the changes from ${{github.event.inputs.branch}}'

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ package.tgz
4141
# Only contains the Webpack cache
4242
/packages/docusaurus/.yarn
4343

44+
# Used by /scripts/stable-versions-store.js
45+
/scripts/stable-versions-store.json
46+
4447
/vscode-case-study
4548

4649
.idea

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /