-
Notifications
You must be signed in to change notification settings - Fork 409
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
Add scripts for publishing to VS Code Marketplace #12
Merged
+358
−56
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
96a22a9
Simplify command invocations are npm scripts
489036e
Add shortcuts for running these commands from VS Code
87ef518
Use shx to run scripts in platform-agnostic manner
dd7ab87
Add scripts to help with packaging and publishing of .vsix
6ebb82d
Add instructions on how to publish
fa5ad35
Remove node as the caller for mocha
759f0dc
Clarify how to run on Windows
c62a557
Fix typos
a3da78a
v0.2.0
4f5fe51
Add force-publish
d38a549
Fix typos
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
Add scripts to help with packaging and publishing of .vsix
@W-4162004@
There are no files selected for viewing
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
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
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,19 @@ | ||
#!/usr/bin/env node | ||
|
||
const shell = require('shelljs'); | ||
|
||
// Generate the SHA256 for the .vsix that matches the version in package.json | ||
|
||
const packageVersion = JSON.parse(shell.cat('package.json')).version; | ||
const vsix = shell.ls().filter(file => file.match(`-${packageVersion}.vsix`)); | ||
|
||
if (!vsix.length) { | ||
shell.error('No VSIX found matching the requested version in package.json'); | ||
shell.exit(1); | ||
} | ||
|
||
if (/win32/.test(process.platform)) { | ||
shell.exec(`CertUtil -hashfile ${vsix} SHA256`); | ||
} else { | ||
shell.exec(`shasum -a 256 ${vsix}`); | ||
} |
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,24 @@ | ||
#!/usr/bin/env node | ||
|
||
const shell = require('shelljs'); | ||
|
||
// Publishes the .vsix that matches the version in package.json | ||
|
||
const packageVersion = JSON.parse(shell.cat('package.json')).version; | ||
const vsix = shell.ls().filter(file => file.match(`-${packageVersion}.vsix`)); | ||
|
||
if (!vsix.length) { | ||
shell.error('No VSIX found matching the requested version in package.json'); | ||
shell.exit(1); | ||
} | ||
|
||
const vsce = '../../node_modules/.bin/vsce'; | ||
const VSCE_PERSONAL_ACCESS_TOKEN = process.env['VSCE_PERSONAL_ACCESS_TOKEN']; | ||
if (VSCE_PERSONAL_ACCESS_TOKEN) { | ||
shell.exec( | ||
`${vsce} publish --pat ${VSCE_PERSONAL_ACCESS_TOKEN} --packagePath ${vsix}` | ||
); | ||
} else { | ||
// Assume that one has already been configured | ||
shell.exec(`${vsce} publish --packagePath ${vsix}`); | ||
} |
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,54 @@ | ||
#!/usr/bin/env node | ||
|
||
const shell = require('shelljs'); | ||
shell.set('-e'); | ||
shell.set('+v'); | ||
|
||
/* | ||
* Assumptions: | ||
* 0. The script is running locally - it's not optimized for Travis workflow | ||
* yet. | ||
* 1. The script is running in the right branch. | ||
* 2. The script is running in a clean environment - all changes have been | ||
* committed. | ||
*/ | ||
|
||
// Bootstrap | ||
shell.exec('npm run bootstrap'); | ||
|
||
// Compile | ||
shell.exec('npm run compile'); | ||
|
||
// Test | ||
shell.exec('npm run test'); | ||
|
||
// lerna publish | ||
// --skip-npm to increment the version number in all packages but not publish to npmjs | ||
// This will still make a commit in Git with the tag of the version used | ||
const nextVersion = process.env['VERSION_INCREMENT']; | ||
if (nextVersion) { | ||
shell.exec(`lerna publish --exact --repo-version ${nextVersion} --skip-npm`); | ||
} else { | ||
shell.exec('lerna publish --exact --cd-version minor --yes --skip-npm'); | ||
} | ||
|
||
// Generate the .vsix files | ||
shell.exec(`npm run vscode:package`); | ||
|
||
// Generate the SHA256 and append to the file | ||
shell.exec(`npm run vscode:sha256`); | ||
|
||
// Publish to VS Code Marketplace | ||
shell.exec(`npm run vscode:publish`); | ||
|
||
// Push the SHA256 to AWS | ||
shell.exec('aws s3 cp SHA256 s3://dfc-data-production/media/vscode/SHA256'); | ||
|
||
// Add SHA256 to git | ||
shell.exec(`git add SHA256`); | ||
|
||
// Perform these steps manually for now | ||
// Git commit | ||
// shell.exec(`git commit -m "Updated SHA256"`); | ||
// Push back to GitHub | ||
//shell.exec(`git push`); |
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.
I don't actually foresee us using Windows to publish, but this is just in case.