Skip to content

Commit

Permalink
📦 Changing the nodejs build to bun
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashu11-A committed Oct 22, 2024
1 parent 794e33d commit 9289bb4
Showing 1 changed file with 21 additions and 14 deletions.
35 changes: 21 additions & 14 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Build

on:
push:
branches: [ "main" ]
branches: [ "workspace" ]
pull_request:
branches: [ "main" ]
branches: [ "workspace" ]

jobs:
prepare:
Expand All @@ -28,13 +28,23 @@ jobs:
const fs = require('fs')
const path = require('path')
const process = require('process')
const paths = []
const pathName = path.join(process.cwd(), 'plugins')
const files = fs.readdirSync(pathName)
const directories = files.filter((file) => fs.statSync(path.join(pathName, file)).isDirectory()).map((dir) => `plugins/${dir}`)
paths.push(...getProjects('plugins'))
paths.push(...getProjects('packages'))
directories.push('core')
core.setOutput('paths', directories)
paths.push('core')
console.log(paths)
core.setOutput('paths', paths)
function getProjects(dirname) {
const pathName = path.join(process.cwd(), dirname)
const files = fs.readdirSync(pathName)
const directories = files.filter((file) => fs.statSync(path.join(pathName, file)).isDirectory()).map((dir) => `${dirname}/${dir}`)
return directories
}
build:
name: Build ${{ matrix.path }}
runs-on: ubuntu-latest
Expand All @@ -46,13 +56,10 @@ jobs:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
- uses: oven-sh/setup-bun@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
check-latest: true
bun-version: latest
- run: |
cd ${{ matrix.path }} &&
npm ci &&
npm run build --if-present
bun i &&
bun build ./src/app.ts --target=bun --minify --outfile=build.js

0 comments on commit 9289bb4

Please sign in to comment.