Skip to content

Commit

Permalink
add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
acharyakavita committed Aug 9, 2024
1 parent 5838175 commit 20b985b
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pull Request

on:
pull_request:
push:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]

pull_request:
name: Pull Request
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "yarn"
node-version: 18
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Unit Tests
run: yarn test
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
issues: write
repository-projects: write
deployments: write
packages: write
pull-requests: write

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: "yarn"
node-version: 18
registry-url: "https://registry.npmjs.org"
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Unit Tests
run: yarn test
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"files": [
"index.js"
],
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"test": "jest"
},
Expand All @@ -20,4 +23,4 @@
"react-dom": "^16.8.3",
"react-test-renderer": "^16.8.3"
}
}
}

0 comments on commit 20b985b

Please sign in to comment.