From 3608610340789f3b8d75232a4d9a00366eae3189 Mon Sep 17 00:00:00 2001 From: Mike Coutermarsh Date: Wed, 7 Aug 2019 13:32:43 -0700 Subject: [PATCH] First pass a npm test, build and publish template --- automation/npm-publish.yml | 47 +++++++++++++++++++ .../properties/npm-publish.properties.json | 6 +++ 2 files changed, 53 insertions(+) create mode 100644 automation/npm-publish.yml create mode 100644 automation/properties/npm-publish.properties.json diff --git a/automation/npm-publish.yml b/automation/npm-publish.yml new file mode 100644 index 0000000..75efa71 --- /dev/null +++ b/automation/npm-publish.yml @@ -0,0 +1,47 @@ +name: Test, build and publish NPM package + +on: + pull_request: + branches: + - master + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + version: 12 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + version: 12 + registry-url: https://registry.npmjs.org/ + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} + + publish-gpr: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + version: 12 + registry-url: https://npm.pkg.github.com/ + scope: '@your-github-username' + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{github.token}} diff --git a/automation/properties/npm-publish.properties.json b/automation/properties/npm-publish.properties.json new file mode 100644 index 0000000..537026a --- /dev/null +++ b/automation/properties/npm-publish.properties.json @@ -0,0 +1,6 @@ +{ + "name": "Test, build and publish NPM package", + "description": "Publishes an NPM package to NPM and GitHub Package Registry", + "iconName": "octicon smiley", + "categories": ["Automation", "SDLC"] +}