diff --git a/.github/workflows/create-or-update-release-pr.yml b/.github/workflows/create-or-update-release-pr.yml index 9d701cc6fc..6441bd894e 100644 --- a/.github/workflows/create-or-update-release-pr.yml +++ b/.github/workflows/create-or-update-release-pr.yml @@ -30,15 +30,15 @@ jobs: uses: actions/checkout@v4 with: repository: opentelemetrybot/opentelemetry-js - ref: main + ref: v1.x token: ${{ secrets.OPENTELEMETRYBOT_GITHUB_TOKEN }} - name: Sync with upstream run: | git remote show origin git remote add upstream https://github.com/open-telemetry/opentelemetry-js.git git fetch upstream - git reset --hard upstream/main - git push origin main --force + git reset --hard upstream/v1.x + git push origin v1.x --force - uses: actions/setup-node@v4 with: diff --git a/doc/contributing/releasing.md b/doc/contributing/releasing.md index 18246c3cf8..6b8b1ffd73 100644 --- a/doc/contributing/releasing.md +++ b/doc/contributing/releasing.md @@ -7,8 +7,9 @@ We aim to eventually automate this process as much as possible. 1. Go to the [Release PR Workflow](https://github.com/open-telemetry/opentelemetry-js/actions/workflows/create-or-update-release-pr.yml) 2. Click "Run workflow" -3. For `Release Type`, select if you want to create a release PR for a new `minor` or `patch` version. -4. For `Release Scope`, select if you want to release +3. For `Branch`, select the branch you want to release from, `main` (current major) or `1.x` (if you backported something) +4. For `Release Type`, select if you want to create a release PR for a new `minor` or `patch` version. +5. For `Release Scope`, select if you want to release - `experimental` (all packages under `./experimental/packages`) - `sdk` (all packages under `./packages/` and `./experimental/packages`) - `all` (all packages under `./api/`, `./packages/` and `./experimental/packages`; excludes `./semantic-conventions/`) @@ -26,11 +27,11 @@ We aim to eventually automate this process as much as possible. ## 3. Publish to NPM > [!IMPORTANT] -> This step will publish anything that's on `main` IF AND ONLY IF the version has been bumped. If the version for a package +> This step will publish anything that's on the branch you're releasing from IF AND ONLY IF the version has been bumped. If the version for a package > has not been bumped, it will not publish a new version of the package. 1. Go to the [NPM publish workflow](https://github.com/open-telemetry/opentelemetry-js/actions/workflows/publish-to-npm.yml) -2. Click "Run workflow" (from main) +2. Click "Run workflow" (from `main` or `v1.x`, based on what branch you chose to create the release PR for) 1. In rare cases not all packages are published due to a race when publishing, if you suspect this to be the case, re-run the workflow: there should be enough time from 1. diff --git a/package.json b/package.json index bc26a5c9f2..2192e9dc3a 100644 --- a/package.json +++ b/package.json @@ -60,19 +60,19 @@ "_changelog:prepare_semconv": "node scripts/update-changelog.js ./semantic-conventions/CHANGELOG.md ./semantic-conventions/package.json", "_changelog:prepare_all": "npm run _changelog:prepare_api && npm run _changelog:prepare_experimental && npm run _changelog:prepare_stable", "_github:draft_release:all": "npm run _github:draft_release:api && _github:draft_release:experimental && _github:draft_release:stable", - "_github:draft_release:api": "node scripts/extract-latest-release-notes.js ./api/CHANGELOG.md && VERSION=$(node scripts/get-version.js ./api/package.json | grep -oE '^[0-9]+\\.[0-9]+\\.[0-9]+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target main --title api/v$VERSION api/v$VERSION", - "_github:draft_release:experimental": "node scripts/extract-latest-release-notes.js ./experimental/CHANGELOG.md && VERSION=$(node scripts/get-version.js ./experimental/packages/ | grep -oE '^[0-9]+\\.[0-9]+\\.[0-9]+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target main --title experimental/v$VERSION experimental/v$VERSION", - "_github:draft_release:stable": "node scripts/extract-latest-release-notes.js ./CHANGELOG.md && VERSION=$(node scripts/get-version.js ./packages/ | grep -oE '^[0-9]+\\.[0-9]+\\.[0-9]+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target main --title v$VERSION v$VERSION", - "_github:draft_release:semconv": "node scripts/extract-latest-release-notes.js ./semantic-conventions/CHANGELOG.md && VERSION=$(node scripts/get-version.js ./semantic-conventions/package.json | grep -oE '^[0-9]+\\.[0-9]+\\.[0-9]+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target main --title semconv/v$VERSION semconv/v$VERSION", - "_github:update_release_pr_body_from_file": "gh pr edit --repo open-telemetry/opentelemetry-js $RELEASE_PR_OWNER:release/next-version --body-file ./.tmp/release-notes.md", + "_github:draft_release:api": "node scripts/extract-latest-release-notes.js ./api/CHANGELOG.md && VERSION=$(node scripts/get-version.js ./api/package.json | grep -oE '^[0-9]+\\.[0-9]+\\.[0-9]+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target v1.x --title api/v$VERSION api/v$VERSION", + "_github:draft_release:experimental": "node scripts/extract-latest-release-notes.js ./experimental/CHANGELOG.md && VERSION=$(node scripts/get-version.js ./experimental/packages/ | grep -oE '^[0-9]+\\.[0-9]+\\.[0-9]+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target v1.x --title experimental/v$VERSION experimental/v$VERSION", + "_github:draft_release:stable": "node scripts/extract-latest-release-notes.js ./CHANGELOG.md && VERSION=$(node scripts/get-version.js ./packages/ | grep -oE '^[0-9]+\\.[0-9]+\\.[0-9]+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target v1.x --title v$VERSION v$VERSION", + "_github:draft_release:semconv": "node scripts/extract-latest-release-notes.js ./semantic-conventions/CHANGELOG.md && VERSION=$(node scripts/get-version.js ./semantic-conventions/package.json | grep -oE '^[0-9]+\\.[0-9]+\\.[0-9]+$') && gh release create --draft --notes-file ./.tmp/release-notes.md --target v1.x --title semconv/v$VERSION semconv/v$VERSION", + "_github:update_release_pr_body_from_file": "gh pr edit --repo open-telemetry/opentelemetry-js $RELEASE_PR_OWNER:release/next-v1-version --body-file ./.tmp/release-notes.md", "_github:update_release_pr_body:all": "node scripts/extract-latest-release-notes.js api/CHANGELOG.md ./CHANGELOG.md experimental/CHANGELOG.md && npm run _github:update_release_pr_body_from_file", "_github:update_release_pr_body:sdk": "node scripts/extract-latest-release-notes.js ./CHANGELOG.md experimental/CHANGELOG.md && npm run _github:update_release_pr_body_from_file", "_github:update_release_pr_body:experimental": "node scripts/extract-latest-release-notes.js experimental/CHANGELOG.md && npm run _github:update_release_pr_body_from_file", "_github:update_release_pr_body:semconv": "node scripts/extract-latest-release-notes.js semantic-conventions/CHANGELOG.md && npm run _github:update_release_pr_body_from_file", "_verify_release_kind": "echo $RELEASE_KIND | grep -oE '^(all|sdk|experimental|semconv):(minor|patch)$'", "_verify_release_remote": "git remote get-url $RELEASE_PR_REMOTE", - "_github:update_release_branch": "npm run _verify_release_kind && npm run _verify_release_remote && (git checkout main && git pull upstream main && git branch -D release/next-version; git checkout -b release/next-version && npm run prepare_release:$RELEASE_KIND && git commit -am \"chore: prepare release\" && git push --set-upstream $RELEASE_PR_REMOTE --force release/next-version)", - "github:create_or_update_release_pr": "npm run _github:update_release_branch && (gh pr create --repo open-telemetry/opentelemetry-js --title 'chore: prepare next release' --body ''; npm run _github:update_release_pr_body:$RELEASE_SCOPE)" + "_github:update_release_branch": "npm run _verify_release_kind && npm run _verify_release_remote && (git checkout v1.x && git pull upstream v1.x && git branch -D release/next-v1-version; git checkout -b release/next-v1-version && npm run prepare_release:$RELEASE_KIND && git commit -am \"chore: prepare release\" && git push --set-upstream $RELEASE_PR_REMOTE --force release/next-v1-version)", + "github:create_or_update_release_pr": "npm run _github:update_release_branch && (gh pr create --repo open-telemetry/opentelemetry-js --title 'chore: prepare next v1.x release' --body ''; npm run _github:update_release_pr_body:$RELEASE_SCOPE)" }, "repository": "open-telemetry/opentelemetry-js", "keywords": [