-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: make releases create a new PR instead of committing in main. (#11)
ci: make releases create a new PR instead of committing in main. EX-3886
- Loading branch information
1 parent
e09d20a
commit 5a157e9
Showing
4 changed files
with
33 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,9 +30,14 @@ jobs: | |
git config --local user.email "[email protected]" | ||
git config --local user.name "empathy/x" | ||
- name: Prepare the release | ||
run: "npm run prepare-release:${{ github.event.inputs.kind }}" | ||
- name: Push changes | ||
uses: ad-m/github-push-action@master | ||
run: npm run prepare-release:${{ github.event.inputs.kind }} | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v3 | ||
with: | ||
github_token: ${{ secrets.SUPPORT_TOKEN }} | ||
branch: ${{ github.ref }} | ||
token: ${{ secrets.SUPPORT_TOKEN }} | ||
commit-message: "chore(release): prepare ${{ github.event.inputs.kind }} release" | ||
committer: Interface X <[email protected]> | ||
title: ${{ github.event.inputs.kind }} release | ||
body: Release preparation | ||
branch: release | ||
delete-branch: true |
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,9 +1,10 @@ | ||
const { exec } = require('./utils'); | ||
|
||
const [releaseKind = 'stable'] = process.argv.slice(2); | ||
const releaseKindArgument = releaseKind === 'alpha' ? '--conventional-prerelease' : '--conventional-graduate'; | ||
execLernaVersion(); | ||
|
||
[ | ||
`lerna version --conventional-commits --no-git-tag-version --yes ${ releaseKindArgument }`, | ||
`git commit -m "chore(release): prepare ${releaseKind} release" -a` | ||
].forEach(exec); | ||
function execLernaVersion() { | ||
const [releaseKind = 'stable'] = process.argv.slice(2); | ||
const releaseKindArgument = | ||
releaseKind === 'alpha' ? '--conventional-prerelease' : '--conventional-graduate'; | ||
exec(`lerna version --conventional-commits --no-git-tag-version --yes ${releaseKindArgument}`); | ||
} |
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,8 +1,12 @@ | ||
const { exec } = require('./utils'); | ||
|
||
const changedPackages = JSON.parse(exec('lerna changed --json')); | ||
exec(`lerna publish from-package --yes`); | ||
changedPackages.forEach(changed => { | ||
const tag = `${ changed.name }@${ changed.version }`; | ||
exec(`git tag -a ${tag} -m "${tag}"`); | ||
}); | ||
addVersionTagForChangedPackages(); | ||
|
||
function addVersionTagForChangedPackages() { | ||
const changedPackages = JSON.parse(exec('lerna changed --json')); | ||
exec(`lerna publish from-package --yes`); | ||
changedPackages.forEach(changed => { | ||
const tag = `${changed.name}@${changed.version}`; | ||
exec(`git tag -a ${tag} -m "${tag}"`); | ||
}); | ||
} |