Skip to content

chore: add node 20 #285

chore: add node 20

chore: add node 20 #285

Workflow file for this run

name: Test and release
# Run the workflow when a Pull Request is opened or when changes are pushed to master
on:
pull_request:
push:
branches: [main, beta]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
# Run the steps below with the following versions of Node.js
node-version: [20.x]
env:
DATABASE_URL: "file:./dev.db"
steps:
# Fetch the latest commit
- name: Checkout
uses: actions/checkout@v4
# Setup Bun
- name: Setup Bun
uses: oven-sh/setup-bun@v1
# Install package dependencies
- name: Install
run: bun i
# Run migrations
- name: Migrate
run: bun migrate
# Run tests
- name: Test
run: bun test
release:
# Only release on push to main
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta')
runs-on: ubuntu-latest
# Waits for test jobs for each Node.js version to complete
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Install
run: bun i
- name: Release
run: bunx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}