-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #347 from carstencodes/contrib/carstencodes/deploy…
…ments/javascript feat: Added support for distribution via NPM
- Loading branch information
Showing
26 changed files
with
1,566 additions
and
28 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
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,42 @@ | ||
--- | ||
name: Publish NPM Package | ||
on: | ||
workflow_dispatch: | ||
workflow_run: | ||
workflows: [goreleaser] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
publish_npm: | ||
name: Publish NPM | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-tags: true | ||
- name: Install node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
- name: Install dependencies | ||
working-directory: ./bdist/js | ||
run: npm install --ignore-scripts | ||
- name: Set package version | ||
working-directory: ./bdist/js | ||
run: npm run version | ||
- name: Pack NPM Package | ||
working-directory: ./bdist/js | ||
run: npm pack | ||
- name: Issue warning if NPM_TOKEN is not set | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
echo "::warning title=Missing authentication token::In order to publish an NPM package, you must set the NPM_TOKEN secret" | ||
if: ${{ env.NODE_AUTH_TOKEN == '' }} | ||
- name: Publish NPM package | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: npm publish | ||
if: ${{ env.NODE_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
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,12 @@ | ||
{ | ||
"name": "protolint_user", | ||
"version": "0.1.0", | ||
"protolint": { | ||
"rules_option":{ | ||
"indent": { | ||
"style": "\t", | ||
"newline": "\n" | ||
} | ||
} | ||
} | ||
} |
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,10 @@ | ||
{ | ||
"protolint": { | ||
"rules_option":{ | ||
"indent": { | ||
"style": "\t", | ||
"newline": "\n" | ||
} | ||
} | ||
} | ||
} |
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,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,10 @@ | ||
{ | ||
"protolint": { | ||
"rules_option":{ | ||
"indent": { | ||
"style": "\t", | ||
"newline": "\r\n" | ||
} | ||
} | ||
} | ||
} |
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,6 @@ | ||
--- | ||
lint: | ||
rules_option: | ||
indent: | ||
style: tab | ||
newline: "\n" |
10 changes: 10 additions & 0 deletions
10
_testdata/js_config/package_with_yaml_parent/child/package.json
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,10 @@ | ||
{ | ||
"protolint": { | ||
"rules_option":{ | ||
"indent": { | ||
"style": "\t", | ||
"newline": "\r\n" | ||
} | ||
} | ||
} | ||
} |
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,6 @@ | ||
--- | ||
lint: | ||
rules_option: | ||
indent: | ||
style: tab | ||
newline: "\n" |
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,21 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
var path = require('path'); | ||
var execFile = require('child_process').execFile; | ||
|
||
var exe_ext = process.platform === 'win32' ? '.exe' : ''; | ||
|
||
var protoc = path.resolve(__dirname, 'protoc-gen-protolint' + exe_ext); | ||
|
||
var args = process.argv.slice(2); | ||
|
||
var child_process = execFile(protoc, args, null); | ||
|
||
child_process.stdout.pipe(process.stdout); | ||
child_process.stderr.pipe(process.stderr); | ||
|
||
child_process.on("exit", (exit_code, _) => { | ||
process.exit(exit_code); | ||
}); |
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,22 @@ | ||
#!/usr/bin/env node | ||
|
||
'use strict'; | ||
|
||
var path = require('path'); | ||
var execFile = require('child_process').execFile; | ||
|
||
var exe_ext = process.platform === 'win32' ? '.exe' : ''; | ||
|
||
var protoc = path.resolve(__dirname, 'protolint' + exe_ext); | ||
|
||
var args = process.argv.slice(2); | ||
|
||
var child_process = execFile(protoc, args, null); | ||
|
||
child_process.stdout.pipe(process.stdout); | ||
child_process.stderr.pipe(process.stderr); | ||
|
||
child_process.on("exit", (exit_code, _) => { | ||
process.exit(exit_code); | ||
}); | ||
|
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,8 @@ | ||
'use strict'; | ||
|
||
/** | ||
* package.json requires this file to be present. In the future, this can | ||
* export useful information about the included tools. | ||
*/ | ||
|
||
module.exports = {}; |
Oops, something went wrong.