Skip to content

Commit

Permalink
build: Cleanup release scripts (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles authored Nov 27, 2024
1 parent 2017194 commit 6ec480b
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 16 deletions.
28 changes: 13 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,20 @@ https://code.visualstudio.com/api/working-with-extensions/publishing-extension#p
### Publish a new Version
1. Set `VSCE_PAT` env variable to personal access token for a user in the https://dev.azure.com/deephaven-oss/ org.
1. Increment the version number in `package.json` (be sure to run `npm i` to update package-lock as well)
> See [versioning strategy](#versioning-strategy) for details on our version number scheme.
1. If new content has been added that needs to be packaged that is not included by `.vscodeignore`, make appropriate changes (this should not be common).
1. Package latest `npm run package:latest` (inspect output to verify included files are as expected)
1. Use `vsce` cli to publish to Visual Studio Marketplace
See [versioning strategy](#versioning-strategy) for details on our version number scheme.
```sh
# Pre-release
npm run publish:prerelease
```
1. Create a version tag with `-pre` suffix.
```sh
npm run publish:tag
git push --tags
```
#### Before Publishing
1. Verify the contents of the package will be what you expect:
```sh
npx vsce ls
```
1. If new content has been added that is not included in the output, you may need to tweak the `.vscodeignore`, to make sure it is included (this should not be common).
1. Optionally run `npm run package:latest` if you want to locally install a `.vsix` for testing before publishing.
#### Pre-Release Versions
1. Make sure you are in a clean branch whose HEAD points to the commit to publish.
1. Make sure you are logged in with `vsce` using a personal access token for a user in the https://dev.azure.com/deephaven-oss/ org. `npx vsce login deephaven`
1. Run `npm run publish:prerelease`
## PNG Generation
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
"icon:gen": "node icons/generate.mjs",
"package:latest": "vsce package -o releases/vscode-deephaven-latest.vsix",
"publish:prerelease": "vsce publish --pre-release",
"publish:tag": "git tag v$(node -p -e \"require('./package.json').version\")-pre",
"report:ctrfmerge": "ctrf merge e2e/reports --keep-reports --output-dir test-reports --output ctrf-report.json",
"report:ctrfsummary": "github-actions-ctrf test-reports/ctrf-report.json",
"report:junit2ctrf": "junit-to-ctrf test-reports/vitest.junit.xml --output test-reports/ctrf-report.json",
Expand Down
16 changes: 16 additions & 0 deletions scripts/publish-prerelease.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

# Determine current npm version and calculate next patch version
current=$(node -p -e "require('./package.json').version")
next=$(npx semver $current -i patch)

# Create a new branch, update the version, and create a new tag
git checkout -b v$next-pre
npm version --git-tag-version=false $next
git tag $next-pre
git push --tags

# Publish a pre-release version of the extension to the Marketplace
npx vsce publish --pre-release

0 comments on commit 6ec480b

Please sign in to comment.