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

Add scripts to prepare releases automatically #3805

Merged
merged 7 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
12 changes: 12 additions & 0 deletions .github/workflows/label-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
on:
pull_request_target:
branches:
- main

jobs:
label-release:
if: ${{ startsWith(github.event.pull_request.title, 'release:') }}
runs-on: ubuntu-latest
steps:
- run: echo this is a release PR
- run: gh pr edit ${{ github.event.pull_request.number }} --add-label release
20 changes: 18 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,24 @@
"lint:markdown": "./node_modules/.bin/markdownlint $(git ls-files '*.md') -i ./CHANGELOG.md",
"lint:markdown:fix": "./node_modules/.bin/markdownlint $(git ls-files '*.md') -i ./CHANGELOG.md --fix",
"reset": "lerna clean -y && rm -rf node_modules && npm i && npm run compile && npm run lint:fix",
"update-ts-configs": "node scripts/update-ts-configs.js"
"update-ts-configs": "node scripts/update-ts-configs.js",

"comment_prepare_1": "echo scripts in this section automatically prepare releases. Intended for use by maintainers only.",
"comment_prepare_2": "echo experimental preparation scripts only prepare experimental packages",
"prepare_release:experimental:patch": "npm run _check:no_changes && npm run _backup:lerna && npm run _lerna:remove_api && npm run _lerna:remove_stable && npm run _lerna:version_patch && npm run _restore:lerna",
"prepare_release:experimental:minor": "npm run _check:no_changes && npm run _backup:lerna && npm run _lerna:remove_api && npm run _lerna:remove_stable && npm run _lerna:version_minor && npm run _restore:lerna",
"comment_prepare_3": "echo sdk preparation scripts prepare all stable and experimental packages",
"prepare_release:sdk:patch": "npm run _check:no_changes && npm run _backup:lerna && npm run _lerna:remove_api && npm run _lerna:version_patch && npm run _restore:lerna",
"prepare_release:sdk:minor": "npm run _check:no_changes && npm run _backup:lerna && npm run _lerna:remove_api && npm run _lerna:version_minor && npm run _restore:lerna",

"comment_internal": "echo scripts below this line are for internal use",
"_check:no_changes": "if [ ! -z \"$(git status -uno --porcelain)\" ]; then echo Please ensure all changes are committed; exit 1; fi",
dyladan marked this conversation as resolved.
Show resolved Hide resolved
"_backup:lerna": "cp lerna.json lerna.json.backup",
"_restore:lerna": "mv lerna.json.backup lerna.json",
"_lerna:remove_api": "node -e 'var fs=require(\"fs\");var l=require(\"./lerna.json\");l.packages=l.packages.filter(p=>p!==\"api\");fs.writeFileSync(\"lerna.json\",JSON.stringify(l,null,2))'",
"_lerna:remove_stable": "node -e 'var fs=require(\"fs\");var l=require(\"./lerna.json\");l.packages=l.packages.filter(p=>p!==\"packages/*\");fs.writeFileSync(\"lerna.json\",JSON.stringify(l,null,2))'",
"_lerna:version_patch": "npx lerna version patch --exact --no-git-tag-version --no-push --yes",
"_lerna:version_minor": "npx lerna version minor --exact --no-git-tag-version --no-push --yes"
},
"repository": "open-telemetry/opentelemetry-js",
"keywords": [
Expand All @@ -55,7 +72,6 @@
"eslint-plugin-prettier": "4.2.1",
"gh-pages": "5.0.0",
"lerna": "6.0.3",
"lerna-changelog": "2.2.0",
"linkinator": "4.0.3",
"markdownlint-cli": "0.32.2",
"prettier": "2.8.0",
Expand Down