Skip to content

Commit

Permalink
add pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Iachini committed Feb 23, 2024
1 parent 22b233e commit da9b288
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: CI

on:
- push
- pull_request

jobs:
ci:
name: Lint and Test with Node.js ${{ matrix.node }}
strategy:
matrix:
node:
- 16
- 18
- 20
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: yarn

- name: Install Dependencies
run: yarn --immutable

- name: Test
run: yarn test
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn

- name: Install Dependencies
run: yarn --immutable

- name: CI check
run: yarn ci

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
commit: 'chore: release package(s)'
title: 'chore: release package(s)'
version: yarn version
publish: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
},
"scripts": {
"test": "jest",
"build": "tsc"
"build": "tsc",
"release": "changeset publish --tag release-v1",
"version": "changeset version && yarn --no-immutable"
},
"peerDependencies": {
"prettier": "^3.1.1"
Expand Down

0 comments on commit da9b288

Please sign in to comment.