-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Github Action publish to npm for libms (#1024)
Publishes libms npm package to both github and npmjs.com
- Loading branch information
Showing
7 changed files
with
101 additions
and
48 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 |
---|---|---|
|
@@ -8,8 +8,6 @@ on: | |
paths: | ||
- 'client/**' | ||
workflow_dispatch: | ||
paths: | ||
- 'client/**' | ||
|
||
jobs: | ||
client: | ||
|
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 |
---|---|---|
|
@@ -8,8 +8,6 @@ on: | |
paths: | ||
- 'docs/**' | ||
workflow_dispatch: | ||
paths: | ||
- 'docs/**' | ||
|
||
jobs: | ||
docs: | ||
|
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,58 @@ | ||
name: Test and Publish | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
registry-url: | ||
required: true | ||
type: string | ||
directory: | ||
required: true | ||
type: string | ||
node-version: | ||
required: true | ||
type: string | ||
package-name: | ||
default: '' | ||
type: string | ||
secrets: | ||
NPM_TOKEN: | ||
required: true | ||
|
||
jobs: | ||
publish-package: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
contents: read | ||
defaults: | ||
run: | ||
working-directory: ${{ inputs.directory }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
always-auth: true | ||
registry-url: ${{ inputs.registry-url }} | ||
|
||
- name: Rename package name in package.json | ||
if: ${{ inputs.package-name != '' }} | ||
run: | | ||
sudo apt-get install -y jq | ||
jq '.name = "${{inputs.package-name}}"' package.json > temp.json | ||
mv temp.json package.json | ||
- name: Publish npm package | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: | | ||
yarn install | ||
yarn build | ||
yarn publish --access public | ||
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 |
---|---|---|
@@ -1,12 +1,13 @@ | ||
{ | ||
"name": "@into-cps-association/libms", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"description": "microservices that handles request by fetching and returning the file-names and folders of given directory", | ||
"author": "[email protected]", | ||
"contributors": [ | ||
"Prasad Talasila", | ||
"Mads Kelberg", | ||
"Linda Nguyen" | ||
"Linda Nguyen", | ||
"Nichlaes H. Sørensen" | ||
], | ||
"private": false, | ||
"license": "SEE LICENSE IN <LICENSE.md>", | ||
|