From a07dbb48b34809123e094a83cb6dff040f6c24eb Mon Sep 17 00:00:00 2001 From: leopoldhub Date: Fri, 18 Mar 2022 00:18:36 +0100 Subject: [PATCH 1/2] Create npm-publish.yml --- .github/workflows/npm-publish.yml | 67 +++++++++++++++++++++++++++++++ 1 file changed, 67 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..9e590bc --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,67 @@ +# 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: + workflow_dispatch: + inputs: + logLevel: + description: 'Log level' + required: true + default: 'warning' + type: choice + options: + - info + - warning + - debug + print_tags: + description: 'True to print to STDOUT' + required: true + type: boolean + tags: + description: 'Test scenario tags' + required: true + type: string + environment: + description: 'Environment to run tests against' + type: environment + required: true +# release: +# types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + - run: npm ci + - run: npm run build + #- run: npm test + - uses: actions/cache@v2 + id: restore-build + with: + path: ./* + key: ${{ github.sha }} + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 16 + registry-url: https://registry.npmjs.org/ + - uses: actions/cache@v2 + id: restore-build + with: + path: ./* + key: ${{ github.sha }} + - run: ls + #- run: npm publish + # env: + # NODE_AUTH_TOKEN: ${{secrets.npm_token}} From 7a2555c7d92be452a1b364a2c09cd49c478c180f Mon Sep 17 00:00:00 2001 From: leopoldhub Date: Fri, 18 Mar 2022 00:22:03 +0100 Subject: [PATCH 2/2] Update npm-publish.yml --- .github/workflows/npm-publish.yml | 33 +++++-------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 9e590bc..3ad2853 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -4,31 +4,8 @@ name: Node.js Package on: - workflow_dispatch: - inputs: - logLevel: - description: 'Log level' - required: true - default: 'warning' - type: choice - options: - - info - - warning - - debug - print_tags: - description: 'True to print to STDOUT' - required: true - type: boolean - tags: - description: 'Test scenario tags' - required: true - type: string - environment: - description: 'Environment to run tests against' - type: environment - required: true -# release: -# types: [created] + release: + types: [created] jobs: build: @@ -62,6 +39,6 @@ jobs: path: ./* key: ${{ github.sha }} - run: ls - #- run: npm publish - # env: - # NODE_AUTH_TOKEN: ${{secrets.npm_token}} + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}}