Skip to content

Commit

Permalink
Publish npm
Browse files Browse the repository at this point in the history
  • Loading branch information
maitham committed Mar 24, 2022
1 parent 564b7f3 commit 052fbe7
Showing 1 changed file with 11 additions and 50 deletions.
61 changes: 11 additions & 50 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,18 @@
name: CI
name: Publish Package to npmjs
on:
push:
branches:
- "main"
release:
types: [created]
jobs:
build:
name: Build, lint, and test on Node ${{ matrix.node }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node: ['10.x', '12.x', '14.x']
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Checkout repo
uses: actions/checkout@v2

- name: Use Node ${{ matrix.node }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1

- name: Lint
run: yarn lint

- name: Build
run: yarn build
publish:
needs: build
name: Build, lint, and test on Node 10
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Use Node 10
uses: actions/setup-node@v1
- uses: actions/checkout@v2
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v2
with:
node-version: 10
- name: Install deps and build (with cache)
uses: bahmutov/npm-install@v1
- name: Build
run: yarn build
- name: 'Automated Version Bump'
uses: 'phips28/gh-action-bump-version@master'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
target-branch: 'main'
- uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public

NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

0 comments on commit 052fbe7

Please sign in to comment.