From 0bda8aec268fc58ee775a4b25523c84d6957770a Mon Sep 17 00:00:00 2001 From: CodeCommando Date: Thu, 1 Jul 2021 09:00:56 +0530 Subject: [PATCH 1/2] added command to install packages added command to install packages after repo is cloned locally --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8322084..b939b96 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,7 @@ You can test your code with: ```bash $ git clone git@github.com:Precogs-com/lambda-boilerplate.git $ cd lambda-boilerplate +$ npm i $ npm run lint $ npm run test ``` @@ -98,4 +99,4 @@ $ npm run test - Support ECT variables as parameters -Inspired by [@harrietty](https://medium.com/northcoders/creating-a-project-generator-with-node-29e13b3cd309) \ No newline at end of file +Inspired by [@harrietty](https://medium.com/northcoders/creating-a-project-generator-with-node-29e13b3cd309) From 8ef723f0e8f9d69e95d1f7af5b7aa3906d64b644 Mon Sep 17 00:00:00 2001 From: CodeCommando Date: Thu, 1 Jul 2021 10:00:18 +0530 Subject: [PATCH 2/2] Create npm-publish.yml --- .github/workflows/npm-publish.yml | 51 +++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..40c33fd --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,51 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14 + - run: npm lint + - run: npm test + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} + + publish-gpr: + needs: build + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 14 + registry-url: https://npm.pkg.github.com/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}