Skip to content

Commit

Permalink
ci: fixes for #73
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Horton <[email protected]>
  • Loading branch information
madpah committed Aug 22, 2023
1 parent d273c6a commit 9c7b227
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .releaserc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
[
"@semantic-release/exec",
{
"verifyConditionsCmd": "node ./scripts/edge-webstore.js verify ${nextRelease.type}",
"verifyConditionsCmd": "node ./scripts/edge-webstore.js verify",
"publishCmd": "node ./scripts/edge-webstore.js publish ${nextRelease.type}"
}
],
Expand Down
10 changes: 7 additions & 3 deletions scripts/edge-webstore.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,25 @@
const fs = require('fs')
const ews = '@plasmo-corp/ewu'

if (process.argv.length !== 4) {
if (process.argv.length < 3) {
console.error(`Expected a two arguments: ${process.argv[1]} <verify|publish> <major|minor|patch>`)
process.exit(1)
}

const SCRIPT_MODE = process.argv[2].toUpperCase()
const RELEASE_TYPE = process.argv[3].toUpperCase()
let RELEASE_TYPE = 'UNKNOWN'
if (SCRIPT_MODE === 'PUBLISH') {
RELEASE_TYPE = process.argv[3].toUpperCase()
}

const PRODUCT_ID = process.env.EDGE_PRODUCT_ID
const CLIENT_ID = process.env.EDGE_CLIENT_ID
const CLIENT_SECRET = process.env.EDGE_CLIENT_SECRET
const ACCESS_TOKEN_URL = process.env.EDGE_ACCESS_TOKEN_URL
const SUBMISSION_NOTES = process.env.EDGE_SUBMISSION_NOTES
const ZIP_PATH = './sonatype-platform-browser-extension.zip'

if (RELEASE_TYPE === 'patch') {
if (RELEASE_TYPE === 'PATCH') {
console.log('Skipping release to Microsoft Edge Webstore for patch release')
process.exit(0)
}
Expand Down

0 comments on commit 9c7b227

Please sign in to comment.