Skip to content

Commit

Permalink
chore: add release-please automation (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
willarmiros authored Sep 21, 2021
1 parent e7e0e00 commit e6465bb
Show file tree
Hide file tree
Showing 86 changed files with 239 additions and 900 deletions.
106 changes: 0 additions & 106 deletions .github/workflows/publish.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
on:
push:
branches:
- main

name: Run Release Please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v2
id: release
with:
command: manifest
token: ${{secrets.RELEASE_PR_TOKEN}}
default-branch: main

# The logic below handles the npm publication:
- name: Checkout Repository
if: ${{ steps.release.outputs.releases_created }}
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v1
if: ${{ steps.release.outputs.releases_created }}
with:
node-version: 14
registry-url: 'https://registry.npmjs.org'

- name: Cache Dependencies
if: ${{ steps.release.outputs.releases_created }}
uses: actions/cache@v2
with:
path: |
node_modules
package-lock.json
detectors/node/*/node_modules
metapackages/*/node_modules
packages/*/node_modules
plugins/node/*/node_modules
plugins/web/*/node_modules
propagators/*/node_modules
key: release-${{ runner.os }}-${{ matrix.container }}-${{ hashFiles('**/package.json') }}

- name: Build Packages
if: ${{ steps.release.outputs.releases_created }}
run: |
npm install
npx lerna bootstrap --no-ci
# Release Please has already incremented versions and published tags, so we just
# need to publish all unpublished versions to NPM here
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package
- name: Publish to NPM
if: ${{ steps.release.outputs.releases_created }}
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
run: npx lerna publish from-package --no-push --no-private --no-git-tag-version --no-verify-access --yes
63 changes: 0 additions & 63 deletions .github/workflows/release-pr.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,6 @@ package.json.lerna_backup

*.iml
.idea

# version.ts file is automatically generated at compile time
version.ts
42 changes: 42 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"detectors/node/opentelemetry-resource-detector-alibaba-cloud": "0.25.0",
"detectors/node/opentelemetry-resource-detector-aws": "0.25.0",
"detectors/node/opentelemetry-resource-detector-gcp": "0.25.0",
"detectors/node/opentelemetry-resource-detector-github": "0.25.0",
"metapackages/auto-instrumentations-node": "0.25.0",
"metapackages/auto-instrumentations-web": "0.25.0",
"packages/opentelemetry-browser-extension-autoinjection": "0.25.0",
"packages/opentelemetry-host-metrics": "0.25.0",
"packages/opentelemetry-id-generator-aws-xray": "0.25.0",
"packages/opentelemetry-test-utils": "0.25.0",
"plugins/node/opentelemetry-instrumentation-aws-lambda": "0.25.0",
"plugins/node/opentelemetry-instrumentation-bunyan": "0.25.0",
"plugins/node/opentelemetry-instrumentation-cassandra": "0.25.0",
"plugins/node/opentelemetry-instrumentation-connect": "0.25.0",
"plugins/node/opentelemetry-instrumentation-dns": "0.25.0",
"plugins/node/opentelemetry-instrumentation-express": "0.25.0",
"plugins/node/opentelemetry-instrumentation-generic-pool": "0.25.0",
"plugins/node/opentelemetry-instrumentation-graphql": "0.25.0",
"plugins/node/opentelemetry-instrumentation-hapi": "0.25.0",
"plugins/node/opentelemetry-instrumentation-ioredis": "0.25.0",
"plugins/node/opentelemetry-instrumentation-knex": "0.25.0",
"plugins/node/opentelemetry-instrumentation-koa": "0.25.0",
"plugins/node/opentelemetry-instrumentation-memcached": "0.25.0",
"plugins/node/opentelemetry-instrumentation-mongodb": "0.25.0",
"plugins/node/opentelemetry-instrumentation-mysql": "0.25.0",
"plugins/node/opentelemetry-instrumentation-mysql2": "0.25.0",
"plugins/node/opentelemetry-instrumentation-nestjs-core": "0.25.0",
"plugins/node/opentelemetry-instrumentation-net": "0.25.0",
"plugins/node/opentelemetry-instrumentation-pg": "0.25.0",
"plugins/node/opentelemetry-instrumentation-pino": "0.25.0",
"plugins/node/opentelemetry-instrumentation-redis": "0.25.0",
"plugins/node/opentelemetry-instrumentation-restify": "0.25.0",
"plugins/node/opentelemetry-instrumentation-router": "0.25.0",
"plugins/node/opentelemetry-instrumentation-winston": "0.25.0",
"plugins/web/opentelemetry-instrumentation-document-load": "0.25.0",
"plugins/web/opentelemetry-instrumentation-user-interaction": "0.25.0",
"plugins/web/opentelemetry-plugin-react-load": "0.25.0",
"propagators/opentelemetry-propagator-aws-xray": "0.25.0",
"propagators/opentelemetry-propagator-grpc-census-binary": "0.25.0",
"propagators/opentelemetry-propagator-ot-trace": "0.25.0"
}
25 changes: 3 additions & 22 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
# Releasing OpenTelemetry Packages (for Maintainers Only)

This document explains how to publish all OT modules at version x.y.z. Ensure that you’re following semver when choosing a version number.

## Auto-generate a Release PR

Navigate to the [Create a Release PR Worflow](https://github.com/open-telemetry/opentelemetry-js-contrib/actions/workflows/release-pr.yml). Click the "Run workflow" dropdown, enter the semver-compliant version to release, then click "Run workflow". It will generate a release pull request from a branch named like `release/x.y.z`.

## Review Release PR

If necessary, update sample code or documentation on the `release/x.y.z` branch to be included in the release. Another maintainer should approve the PR, specifically validating the automatic updates and verifying the tests are passing.

NOTE: If any major changes are merged while the release PR is open, the CHANGELOG on the `release/x.y.z` branch must be manually updated to reflect the change.

## Merge Release PR

After approval, merge the release PR. This will automatically publish all packages. Verify:

* The [publish workflow](https://github.com/open-telemetry/opentelemetry-js-contrib/actions/workflows/publish.yml) runs successfully
* The new version is available in NPM, e.g. for the [Express instrumentation package](https://www.npmjs.com/package/@opentelemetry/instrumentation-express)
* A [GitHub Release](https://github.com/open-telemetry/opentelemetry-js-contrib/releases) was cut correctly, with a tag pointing to the new version, and a body of the changelog

That's it! No need to read on unless something above went wrong.
This repository uses [Release Please](https://github.com/googleapis/release-please) to manage its releases automatically and independently.
Modified packages are automatically published to NPM when the auto-generated Release Please PR is merged.

# Manual Publishing Process

If any step of the above automated process fails, complete the release manually by picking up at the failed step.
For posterity, or in the event of any failures with release-please, the process for performing a manual release is below.

Manual Release Process Steps:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"compile": "npm run version:update && tsc -p .",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"precompile": "tsc --version",
"precompile": "tsc --version && lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
"prewatch": "npm run precompile",
"prepare": "npm run compile",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
"tdd": "npm run test -- --watch-extensions ts --watch",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"compile": "npm run version:update && tsc -p .",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"precompile": "tsc --version",
"precompile": "tsc --version && lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
"prewatch": "npm run precompile",
"prepare": "npm run compile",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
"tdd": "npm run test -- --watch-extensions ts --watch",
Expand Down
18 changes: 0 additions & 18 deletions detectors/node/opentelemetry-resource-detector-aws/src/version.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"compile": "npm run version:update && tsc -p .",
"lint": "eslint . --ext .ts",
"lint:fix": "eslint . --ext .ts --fix",
"precompile": "tsc --version",
"precompile": "tsc --version && lerna run version --scope $(npm pkg get name) --include-filtered-dependencies",
"prewatch": "npm run precompile",
"prepare": "npm run compile",
"test": "nyc ts-mocha -p tsconfig.json 'test/**/*.test.ts'",
"tdd": "npm run test -- --watch-extensions ts --watch",
Expand Down
Loading

0 comments on commit e6465bb

Please sign in to comment.