Skip to content

Commit

Permalink
added publish yml
Browse files Browse the repository at this point in the history
  • Loading branch information
yashaswi-imagekit committed Aug 5, 2024
1 parent 027accb commit 762d989
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 7 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/npmpublish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish

on:
release:
types: [published]


jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Build and Test
run: |
yarn install
yarn run build
yarn run test
env:
CI: true

publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: NPM Publish
run: |
yarn install
yarn run build
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
CI: true
12 changes: 5 additions & 7 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
- push
- pull_request

jobs:
build:
Expand All @@ -13,13 +11,13 @@ jobs:

strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [14.x, 16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- run: yarn install
- run: yarn test

0 comments on commit 762d989

Please sign in to comment.