-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
91 additions
and
3 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env node | ||
|
||
const pjson = require('../../package.json'); | ||
console.log(pjson.version); |
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,9 @@ | ||
#!/usr/bin/env node | ||
|
||
const version = require('../../package.json').version; | ||
const preRelease = version.split('-'); | ||
if (preRelease[1]) { | ||
console.log(preRelease[1].split('.')[0]); | ||
} else { | ||
console.log(''); | ||
} |
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 @@ | ||
#!/usr/bin/env node | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const exec = require('child_process').execSync; | ||
|
||
const versions = exec('npm view amazon-chime-sdk-js versions --json').toString().trim().split("\n"); | ||
// The output would be something like | ||
// [ | ||
// "1.0.0", | ||
// ... | ||
// "2.8.0", <- previous version | ||
// "2.9.0" <- latest version | ||
// ] | ||
|
||
const prev_version = versions[versions.length-3]; | ||
console.log(prev_version.substring(3,prev_version.length-2)) |
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,15 @@ | ||
// Send test report is a minimal script that makes a HTTP POST call to a webhook to send a slack message. | ||
// For example, this script passes results of the browser compatibility report to the webhook so that the amazon-chime-js-sdk team can be notified of the results. | ||
|
||
const axios = require('axios'); | ||
|
||
var myArgs = process.argv.slice(2); | ||
|
||
axios.post(myArgs[0], { | ||
'github_workflow_url': myArgs[1], | ||
'browser_compatibility_tests_status': myArgs[2].toUpperCase() | ||
}, res => { | ||
console.log(res); | ||
}, err => { | ||
console.log(err); | ||
}); |
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,39 @@ | ||
name: Publish | ||
# When a new Github Release is created, publish to NPM | ||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Package | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.release.tag_name }} | ||
- name: Setup Node environment | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 16 | ||
registry-url: https://registry.npmjs.org/ | ||
- name: NPM Install | ||
run: npm install | ||
- name: NPM run build | ||
run: npm run build | ||
- name: Get npm tag name if needed | ||
id: npm_tag | ||
run: | | ||
pre_release_name=$(.github/script/get-pre-release-name.js) | ||
echo "Pre release name:" $pre_release_name | ||
echo ::set-output name=npm_tag::$pre_release_name | ||
- name: Publish to NPM latest | ||
if: steps.npm_tag.outputs.npm_tag == '' | ||
run: echo "npm publish" | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
- name: Publish to NPM with tag | ||
if: steps.npm_tag.outputs.npm_tag != '' | ||
run: echo "npm publish --tag ${{ steps.npm_tag.outputs.npm_tag }}" | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_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