-
Notifications
You must be signed in to change notification settings - Fork 21
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
Prepare for first release to OpenVSX #191
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 or prepare GitHub 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/[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
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 - see documentation: https://github.com/pipe-cd/actions-gh-release#usage |
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,16 @@ | ||
# Releasing/Publishing the Trace Viewer Extension | ||
|
||
The Github workflows are setup to make this relatively simple. | ||
|
||
When it's desired to have a new release: | ||
|
||
- open a Pull Request that steps the version of the extension in `vscode-trace-extension/package.json` | ||
- As part of the PR, update file RELEASE \[1\] in the repo root. Add or modify it to reflect the new version-to-be-released. | ||
e.g. | ||
> tag: v0.1.0 # The tag number will be created. Required. | ||
|
||
- The PR should be automatically updated, and automatically generated release noted added to it | ||
- Upon merging the PR, the GH release will automatically be created, and the release notes added to document it. A release tag, for the new relase will also be created in the repo. | ||
- The release tag should trigger a publish workflow that will build and release a new version of the extension to openvsx.org | ||
|
||
\[1\]: Here is the action that we use. For more details see its documentation: https://github.com/pipe-cd/actions-gh-release#actions-gh-release |
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will that run the release already when a pull request is created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will trigger the action but when it checks the RELEASE file it should immediately exit since there is no "tag" entry in the file yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops - I answered the wrong question, sorry.
When a new PR is created after this is merged, the action will add the automatically created release notes to the PR, leaving the opportunity to make changes if desired (e.g. by using more detailed options in file
RELEASE
). The GitHub release and release tag will only be created upon the/that PR being merged.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More info about how this action works:
https://github.com/pipe-cd/actions-gh-release#actions-gh-release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the answer!