Skip to content

Commit

Permalink
feat: Update Node version and ci actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ch1ller0 committed Mar 1, 2024
1 parent ada8851 commit 58cfe42
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 49 deletions.
88 changes: 44 additions & 44 deletions .github/workflows/push-or-pr.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
on:
push:
branches:
- main
- main
pull_request:
branches:
- main
- main

name: Push or PR
name: Push or PR

jobs:
test:
name: Build, Test and maybe Publish
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
steps:
- name: Check out code
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ matrix.node-version }}-${{ runner.OS }}-npm-${{ hashFiles('package-lock.json') }}
- name: Install deps
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: ESLint
run: npm run test:lint
- name: Type checking
run: npm run test:typecheck
- name: Building packages
run: npm run build
- name: Unit testing (with GC)
run: npm run test:unit:gc
- name: Create Release Pull Request or Publish to npm
id: changesets
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: changesets/action@v1
with:
version: npx changeset version
publish: npx changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Send a notification if a publish happens
if: steps.changesets.outputs.published == 'true'
# You can do something when a publish happens.
run: echo "A new version of ${GITHUB_REPOSITORY} was published!"
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- name: Cache node_modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ matrix.node-version }}-${{ runner.OS }}-npm-${{ hashFiles('package-lock.json') }}
- name: Install deps
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
- name: ESLint
run: npm run test:lint
- name: Type checking
run: npm run test:typecheck
- name: Building packages
run: npm run build
- name: Unit testing (with GC)
run: npm run test:unit:gc
- name: Create Release Pull Request or Publish to npm
id: changesets
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: changesets/action@v1
with:
version: npx changeset version
publish: npx changeset publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Send a notification if a publish happens
if: steps.changesets.outputs.published == 'true'
# You can do something when a publish happens.
run: echo "A new version of ${GITHUB_REPOSITORY} was published!"
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 58cfe42

Please sign in to comment.