diff --git a/.github/workflows/build.yml b/.github/workflows/ci-cd.yml similarity index 59% rename from .github/workflows/build.yml rename to .github/workflows/ci-cd.yml index 91b1e5959..5d8a0b6e4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/ci-cd.yml @@ -1,10 +1,13 @@ -name: CI +name: CI/CD on: push: branches: [ master ] pull_request: branches: [ master ] + release: + types: + - published jobs: @@ -74,3 +77,37 @@ jobs: - name: Check format run: yarn format:check + + publish-next: + name: Publish 'next' packages to npm + needs: build-and-test + if: github.ref == 'refs/heads/master' && github.event_name == 'push' && github.repository == 'eclipse-cdt-cloud/theia-trace-extension' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v4 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + - run: yarn --frozen-lockfile + - run: yarn publish:next + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + + publish-latest: + name: Publish 'latest' packages to npm + needs: build-and-test + if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'eclipse-cdt-cloud/theia-trace-extension' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + # Setup .npmrc file to publish to npm + - uses: actions/setup-node@v4 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + - run: yarn --frozen-lockfile + - run: yarn publish:latest + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.github/workflows/publish-next.yml b/.github/workflows/publish-next.yml deleted file mode 100644 index c991d0d46..000000000 --- a/.github/workflows/publish-next.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: NPM package (next) -on: - push: - branches: [ master ] -# release: -# types: [created] -jobs: - build: - if: github.ref == 'refs/heads/master' && github.event_name == 'push' && github.repository == 'eclipse-cdt-cloud/theia-trace-extension' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - # Setup .npmrc file to publish to npm - - uses: actions/setup-node@v4 - with: - node-version: '18' - registry-url: 'https://registry.npmjs.org' - # Defaults to the user or organization that owns the workflow file - scope: '@theia-ide' - - run: yarn - - run: yarn publish:next - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..0aa615f2e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Release + +on: + push: + branches: + - master + paths: + - 'RELEASE' + pull_request: + types: [opened, synchronize] + branches: + - master + paths: + - 'RELEASE' + +jobs: + gh-release: + name: GitHub release + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - uses: pipe-cd/actions-gh-release@v2.6.0 + with: + release_file: 'RELEASE' + # Actions that run using the auto-generated GitHub token are + # not allowed to trigger a new workflow run. In this case we want + # the tag created by actions-gh-release to re-trigger the main workflow + # and result in publishing the package to npm. + # The following scopes are required when creating the committer token: + # - repo:status, repo_deployment, public_repo, read:org + # See here for more details: + # https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow + token: ${{ secrets.GH_COMMITTER_TOKEN }} + \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8cc2ca712..b6d17e497 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -150,25 +150,25 @@ For issues related to the Trace Viewer, please open a GitHub tracker for the [Th For issues concerning `eclipse-cdt-cloud`, please refer to the contact options listed on the [CDT.Cloud website][cdt-cloud-website]. -[architecture]: https://github.com/theia-ide/theia-trace-extension#architecture +[architecture]: https://github.com/eclipse-cdt-cloud/theia-trace-extension#architecture [cdt-cloud-website]: https://cdt-cloud.io/contact/ -[commit-message-example]: https://github.com/theia-ide/theia-trace-extension/commit/bc18fcd110d7b8433293692421f2e4fb49f89bd6 +[commit-message-example]: https://github.com/eclipse-cdt-cloud/theia-trace-extension/commit/bc18fcd110d7b8433293692421f2e4fb49f89bd6 [commit-message-message]: https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html [commiter-handbook]: https://www.eclipse.org/projects/handbook/#resources-commit [contact-us]: #contact [creating-changes]: https://www.dataschool.io/how-to-contribute-on-github/ [dev-process]: https://eclipse.org/projects/dev_process [eca]: http://www.eclipse.org/legal/ECA.php -[external-components]: https://github.com/theia-ide/theia-trace-extension#related-code -[good-first-issues]: https://github.com/theia-ide/theia-trace-extension/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 +[external-components]: https://github.com/eclipse-cdt-cloud/theia-trace-extension#related-code +[good-first-issues]: https://github.com/eclipse-cdt-cloud/theia-trace-extension/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 [flexible-architecture-video]: https://www.youtube.com/watch?v=8s5vGf45e-g [flexible-architecture-slides]: https://tracingsummit.org/ts/2019/files/Tracingsummit2019-theia-dagenais.pdf -[gitpod-demo]: https://github.com/theia-ide/theia-trace-extension#try-a-live-demo-via-gitpod +[gitpod-demo]: https://github.com/eclipse-cdt-cloud/theia-trace-extension#Nightly-via-Gitpod [ip-policy]: https://www.eclipse.org/org/documents/Eclipse_IP_Policy.pdf [issues]: https://github.com/eclipse-cdt-cloud/theia-trace-extension/issues -[issue-317]: https://github.com/theia-ide/theia-trace-extension/issues/317 -[issue-369]: https://github.com/theia-ide/theia-trace-extension/pull/369/files -[issue-402]: https://github.com/theia-ide/theia-trace-extension/pull/402 +[issue-317]: https://github.com/eclipse-cdt-cloud/theia-trace-extension/issues/317 +[issue-369]: https://github.com/eclipse-cdt-cloud/theia-trace-extension/pull/369/files +[issue-402]: https://github.com/eclipse-cdt-cloud/theia-trace-extension/pull/402 [new-contributors]: #new-contributors [pr-guide]: #pull-request-guidelines [pull-requests]: https://github.com/eclipse-cdt-cloud/theia-trace-extension/pulls diff --git a/README.md b/README.md index c5b45b2e2..556926889 100644 --- a/README.md +++ b/README.md @@ -384,6 +384,43 @@ pip install -r requirements.txt * The virtual environment can be replaced with another setup locally. * Above, the `./requirements.txt` file has [the ADR tool][tools] to install. +## Release/publish + +Publishing this repository's npm packages and creating a corresponding GitHub release with git tag (latest only), all happen on GitHub CI. + +### Publish next packages + +A set of `next` package is automatically published to `npm` every time a PR is merged. + +### Publish latest / release + +Whenever a new release is desired, including publishing a corresponding set of `latest` package to `npm`, it can be triggered through a PR. The following has to be done: + +Create a new branch for your PR. e.g. +```bash +git branch new-release && git checkout new-release +``` + +Then decide if the release shall be a `Major`, `Minor` or `Patch` release and use the corresponding command below to step packages versions, according to the release type. A new release commit will be created: + +``` bash +yarn version:major +# or +yarn version:minor +# or +yarn version:patch +``` + +Modify the _version tag_ in file `./RELEASE`, to match the new release. Then amend the release commit to include this change: + +```bash + +git add RELEASE && git commit --amend +``` + +Finally, push the branch and use it to create a PR. When the PR is merged, a GitHub release should be created with auto-generated release notes, as well as a git tag. Then the `publish-latest` CI job should trigger and if everything goes well, publish the new version of the repo's packages to `npm`. + + [adr]: https://adr.github.io [app-image]: https://www.dorsal.polymtl.ca/files/other/electron-theia-trace-example-app-0.0.1.AppImage [cdt-cloud-demo]: https://try.theia-cloud.io/?appDef=cdt-cloud-demo diff --git a/RELEASE b/RELEASE new file mode 100644 index 000000000..2b8a22cea --- /dev/null +++ b/RELEASE @@ -0,0 +1,8 @@ +tag: v0.0.0 + +commitInclude: + parentOfMergeCommit: true + +releaseNoteGenerator: + showAbbrevHash: true + showCommitter: false diff --git a/lerna.json b/lerna.json index f4e0be375..920fc456f 100644 --- a/lerna.json +++ b/lerna.json @@ -6,12 +6,6 @@ "run": { "stream": true }, - "publish": { - "forcePublish": true, - "graphType": "all", - "skipGit": true, - "registry": "https://registry.npmjs.org/" - }, "verifyAccess": false } } diff --git a/package.json b/package.json index adb3280eb..8326b5185 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,11 @@ "lint": "lerna run lint", "lint:fix": "lerna run lint:fix", "test": "lerna run test --", - "publish:latest": "lerna publish --registry=https://registry.npmjs.org/ --exact --no-git-tag-version --no-push", + "publish:latest": "lerna publish from-git --registry=https://registry.npmjs.org/ --exact --no-push --yes", "publish:next": "lerna publish --registry=https://registry.npmjs.org/ --exact --canary minor --preid=next.$(date -u '+%Y%m%d%H%M%S').$(git rev-parse --short HEAD) --dist-tag=next --no-git-tag-version --no-push --yes", + "version:major": "lerna version major --exact --no-push --git-tag-command /usr/bin/true --yes -m \"Release %s (Major)\"", + "version:minor": "lerna version minor --exact --no-push --git-tag-command /usr/bin/true --yes -m \"Release %s (Minor)\"", + "version:patch": "lerna version patch --exact --no-push --git-tag-command /usr/bin/true --yes -m \"Release %s (Patch)\"", "format:write": "lerna run format:write", "format:check": "lerna run format:check", "browser": "yarn -s --cwd examples/browser", diff --git a/packages/base/README.md b/packages/base/README.md index d30dacf1b..bfb7c8b6f 100644 --- a/packages/base/README.md +++ b/packages/base/README.md @@ -4,6 +4,6 @@ The Trace Viewer base package contains trace management utilities for managing t ## Additional Information -- [Theia Trace Viewer Extension](https://github.com/eclipse-cdt-cloud/theia-trace-extension) -- [Trace Server Protocol](https://github.com/eclipse-cdt-cloud/trace-server-protocol) +- [Theia Trace Viewer Extension git repository](https://github.com/eclipse-cdt-cloud/theia-trace-extension) +- [Trace Server Protocol git repository](https://github.com/eclipse-cdt-cloud/trace-server-protocol) - [Reference Trace Server - Download (Eclipse Trace Compass)](https://download.eclipse.org/tracecompass.incubator/trace-server/rcp/) diff --git a/packages/react-components/README.md b/packages/react-components/README.md index 5925cfbc7..b8f6daf9a 100644 --- a/packages/react-components/README.md +++ b/packages/react-components/README.md @@ -1,15 +1,15 @@ # Description -The Trace Viewer react-components package contains views and utilities for visualizing traces and logs via the Trace Server Protocol connected a Trace Server applications. While being initially used within the Theia Trace Viewer extension, its code base is independent to any Theia APIs and hence can be integrated in other web applications. +The Trace Viewer react-components package contains views and utilities for visualizing traces and logs via the Trace Server Protocol, connected a Trace Server application. While being initially used within the Theia Trace Viewer extension, its code base is independent to any Theia APIs and hence can be integrated in other web applications. ## Styling -The Trace Viewer react-components package does not define CSS styles for its components, but it provides CSS variables that can be map to custom CSS styles or variables. Any projects that use the package should define its own CSS styles for the components. All the mappable variables have the prefix `--trace-viewer`. +The Trace Viewer react-components package does not define CSS styles for its components, but it provides CSS variables that can be map to custom CSS styles or variables. Any project that uses the package should define its own CSS styles for the components. All the mappable variables have the prefix `--trace-viewer`. -An example (of integration with Theia) that contains all the mappable variables can be found in [here](../../theia-extensions/viewer-prototype/style/trace-viewer.css). +An example (of integration with Theia) that contains all the mappable variables can be found in [here](https://github.com/eclipse-cdt-cloud/theia-trace-extension/blob/master/theia-extensions/viewer-prototype/style/trace-viewer.css). ## Additional Information -- [Theia Trace Viewer Extension](https://github.com/eclipse-cdt-cloud/theia-trace-extension) -- [Trace Server Protocol](https://github.com/eclipse-cdt-cloud/trace-server-protocol) +- [Theia Trace Viewer Extension git repository](https://github.com/eclipse-cdt-cloud/theia-trace-extension) +- [Trace Server Protocol git repository](https://github.com/eclipse-cdt-cloud/trace-server-protocol) - [Reference Trace Server - Download (Eclipse Trace Compass)](https://download.eclipse.org/tracecompass.incubator/trace-server/rcp/) diff --git a/packages/react-components/package.json b/packages/react-components/package.json index 01e92fd68..e963ce5a2 100644 --- a/packages/react-components/package.json +++ b/packages/react-components/package.json @@ -7,6 +7,10 @@ "type": "git", "url": "https://github.com/eclipse-cdt-cloud/theia-trace-extension" }, + "bugs": { + "url": "https://github.com/eclipse-cdt-cloud/theia-trace-extension/issues" + }, + "homepage": "https://github.com/eclipse-cdt-cloud/theia-trace-extension", "files": [ "lib", "src", diff --git a/theia-extensions/viewer-prototype/README.md b/theia-extensions/viewer-prototype/README.md index af5aa1579..dc60b31a7 100644 --- a/theia-extensions/viewer-prototype/README.md +++ b/theia-extensions/viewer-prototype/README.md @@ -1,12 +1,14 @@ # Description -The Theia trace viewer extension is providing a trace viewing front-end to Trace Server applications implementing the Trace Server protocol. +The Theia trace viewer extension is a Theia extension, that one can use to add trace viewing capabilities, to a Theia-based application. ## Additional Information -- [Theia Trace Viewer Extension](https://github.com/eclipse-cdt-cloud/theia-trace-extension) -- [Trace Server Protocol](https://github.com/eclipse-cdt-cloud/trace-server-protocol) +- [Theia Trace Viewer Extension git repository](https://github.com/eclipse-cdt-cloud/theia-trace-extension) +- [Trace Server Protocol git repository](https://github.com/eclipse-cdt-cloud/trace-server-protocol) - [Reference Trace Server - Download (Eclipse Trace Compass)](https://download.eclipse.org/tracecompass.incubator/trace-server/rcp/) +- [Theia Trace Viewer Docker appliance example](https://github.com/eclipse-cdt-cloud/theia-trace-extension/blob/master/examples/docker/) +- [CDT Cloud Blueprint git repository (Contains the Theia Trace Viewer Extension)](https://github.com/eclipse-cdt-cloud/cdt-cloud-blueprint) ## Screenshots diff --git a/theia-extensions/viewer-prototype/package.json b/theia-extensions/viewer-prototype/package.json index b397f77ff..4121ba168 100644 --- a/theia-extensions/viewer-prototype/package.json +++ b/theia-extensions/viewer-prototype/package.json @@ -1,7 +1,7 @@ { "name": "theia-traceviewer", "version": "0.1.0", - "description": "Trace Viewer Theia Extension", + "description": "A Trace Viewer for Theia applications, in the form of a Theia extension", "keywords": [ "theia-extension" ], @@ -10,6 +10,10 @@ "type": "git", "url": "https://github.com/eclipse-cdt-cloud/theia-trace-extension" }, + "bugs": { + "url": "https://github.com/eclipse-cdt-cloud/theia-trace-extension/issues" + }, + "homepage": "https://github.com/eclipse-cdt-cloud/theia-trace-extension", "files": [ "lib", "src",