Skip to content

Commit

Permalink
chore(lib): npm publish automation (#255)
Browse files Browse the repository at this point in the history
* chore(lib): npm publish automation

* refactor(ci): run actions when its necessary

* refactor(ci): run actions when its necessary

* chore(lib): npm publish automation
  • Loading branch information
LouisMazel committed May 3, 2022
1 parent 60a2049 commit db10596
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- "release/**"
paths:
- "packages/docs/**"
- "packages/lib/**"

jobs:
doc-build-test:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Doc Build and Deploy
on:
push:
branches: [next]
# paths:
# - "packages/docs/**"
paths:
- "packages/docs/**"
- "packages/lib/**"

jobs:
doc-build-and-deploy:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/lib-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lib Publish To Npm

on:
release:
types: [created]

# on:
# push:
# tags:
# - v*.*.*

jobs:
lib-publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/lib
steps:
- name: Checkout
uses: actions/checkout@master

- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}

- uses: actions/setup-node@master
with:
node-version: "16"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: npm ci

- name: Clean And Build Lib
run: |
make clean-build
make build
- run: npm publish --tag next --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions .github/workflows/lib-test-build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Lib Build Test
on:
push:
branches:
- master
- next
paths:
- "packages/lib/**"
pull_request:
branches:
- master
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/lib-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ name: Lib Test Lint

on:
push:
branches: [master, next]
branches:
- master
- next
paths:
- "packages/lib/**"
pull_request:
branches: [master, next]
paths:
- "packages/lib/**"

jobs:
lib-test-lint:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/lib-test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ on:
branches:
- master
- next
paths:
- "packages/lib/**"
pull_request:
branches:
- master
- next
- "release/**"
paths:
- "packages/lib/**"

jobs:
coverage:
Expand Down

0 comments on commit db10596

Please sign in to comment.