feat: add build and CI configuration files

This commit is contained in:
Lucàs
2025-05-29 09:51:34 +02:00
parent 165213dd10
commit e1353c268c
7 changed files with 130 additions and 104 deletions
+38
View File
@@ -0,0 +1,38 @@
name: CI
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
fail-fast: false
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
- id: setup-bun
name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- id: install-deps
name: Install dependencies
run: |
bun install
- id: test
name: Run test
run: |
bun test
-37
View File
@@ -1,37 +0,0 @@
name: Publish to npm
on:
workflow_dispatch:
release:
types: [created]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Install Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Build with Bun
run: |
bun run build
- name: Set up npm auth
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Debug .npmrc content
run: cat ~/.npmrc
- name: Publish to npm
run: bun publish --access public
env:
npm_config_userconfig: ~/.npmrc
+22
View File
@@ -0,0 +1,22 @@
name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}