-
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.
Prepare for first release to OpenVSX
- Renamed the build workflow to ci-cd and made modifications: - added a publish job, that publishes the .vsix extension to openvsx.org, triggered only when a release tag (v<something>) is pushed to the repo. - merged the build and ui tests jobs. They were redundent, both building the project - removed yarn package caching: practically it helped very little, cutting only ~5% of vs the time it takes to install the dependencies without ~(25s vs 26s) when successful. With a cache miss (run with modified yarn.lock), we incured a 100%+ penalty, if we count the overhead of the cache being saved to GitHub infrastructure. - created a "release" workflow that uses "pipe-cd/actions-gh-release" to to create a release tag and corresponding GitHub release, when a change is detected in root file "RELEASE". See root README for more details. - TL;DR: this is how a release is triggered, by adding the tag value reflecting release version, to RELEASE file as part of a PR. The action will add tentative release notes to the PR that can be edited as needed. Upon merging the PR, a release tag will be created in the repo, which will trigger the publish job, that will eventually result in the new version of the extension being deployed to openvsx.org - it looks like the RELEASE file must exist before its first use in a PR, so created one with no active content. - Added "doc/Publishing.md" to briefly document how to go about creating new releases / publish new releases to openvsx.org - renamed public-facing name (displayName) of the extension to "Trace Viewer for VSCode", to better reflect its nature - changed public-facing mentions of "vscode" to the canonical "VSCode" - changed extension's publisher, to align with the configuration of the CDT Cloud OpenVSX publisher user: "eclipse-cdt". See: https://www.open-vsx.org/namespace/eclipse-cdt - other misc updates to the extension's package.json: added/massaged important fields (https://www.open-vsx.org/namespace/eclipse-cdt). - keept developer-specific information in repo's root README.md but moved generic information, useful to users of the extension, to extension's README (which becomes the information page for the extension when published or installed). - Added an icon for the extension. Though probably not the best ever, re-used the one from repo "theia-trace-extension" Closes #69 Signed-off-by: Marc Dumais <[email protected]>
- Loading branch information
1 parent
77ecfef
commit d9b823e
Showing
16 changed files
with
279 additions
and
137 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: CI/CD | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
|
||
build-test: | ||
name: Build and run UI Tests | ||
timeout-minutes: 60 | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node-version: [16] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- name: Install npm dependencies and build | ||
run: yarn --frozen-lockfile | ||
- name: Package as VSCode Extension | ||
run: yarn vsce:package | ||
- name: Download sample traces | ||
run: yarn download:sample-traces | ||
- name: Download trace server | ||
run: yarn download:server | ||
- name: Start trace server | ||
run: yarn start:server & | ||
- name: Download openvscode-server | ||
run: yarn download:openvscode-server | ||
- name: Configure openvscode-server | ||
run: yarn configure:openvscode-server | ||
- name: Start openvscode-server | ||
run: yarn start:openvscode-server & | ||
- name: Install Playwright Browsers | ||
run: yarn playwright install --with-deps | ||
- name: Run Playwright tests | ||
run: yarn playwright test | ||
- uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 30 | ||
# Save the extension .vsix file for potential publishing | ||
# in later step (if appropriate) | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: extension | ||
path: vscode-trace-extension/*.vsix | ||
|
||
code-lint: | ||
name: Run linter | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node-version: [16] | ||
|
||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
# ESLint and Prettier must be in `package.json` | ||
- name: Install dependencies | ||
run: yarn --frozen-lockfile --ignore-scripts | ||
- name: Run lint | ||
run: yarn lint | ||
- name: Run format check | ||
run: yarn format:check | ||
|
||
publish: | ||
name: Publish extension to openvsx.org | ||
runs-on: ${{ matrix.os }} | ||
needs: | ||
- build-test | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
node-version: [16] | ||
# Only execute when the trigger was a tag (new release) | ||
if: startsWith(github.ref, 'refs/tags/') | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: extension | ||
path: vscode-trace-extension | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install dependencies | ||
run: yarn --frozen-lockfile --ignore-scripts | ||
- name: Publish extension | ||
run: | | ||
ls -al vscode-trace-extension/*.vsix | ||
npx ovsx publish vscode-trace-extension/*.vsix | ||
env: | ||
# have ovsx consume the PAT from environment - if it's not handled explicitly | ||
# in the workflow, less risk to leak it | ||
OVSX_PAT: ${{ secrets.OPEN_VSX_TOKEN }} |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Create GitHub release based on "RELEASE" file | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths: | ||
- 'RELEASE' | ||
pull_request: | ||
types: [opened, synchronize] | ||
branches: | ||
- master | ||
paths: | ||
- 'RELEASE' | ||
|
||
jobs: | ||
gh-release: | ||
name: Create GitHub release | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: pipe-cd/[email protected] | ||
with: | ||
release_file: 'RELEASE' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
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,5 +1,5 @@ | ||
{ | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
# Release file |
Oops, something went wrong.