Skip to content

Commit

Permalink
ci: update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jikkai committed Apr 15, 2024
1 parent 8750f5b commit 40f73e4
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 7 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,28 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
- uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: pnpm
registry-url: ${{ secrets.VERDACCIO_URL }}
scope: '@univerjs-pro'
env:
NODE_AUTH_TOKEN: ${{ secrets.VERDACCIO_TOKEN }}

- name: Build
id: build
run: |
npm install
npm run build
pnpm i
pnpm build
mkdir ${{ env.PLUGIN_NAME }}
echo "Waiting for build files..."
while [ ! -f dist/main.js ] || [ ! -f dist/manifest.json ] || [ ! -f dist/styles.css ]; do
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: 🩺 Test

on:
push:
branches: [master]
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 18

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
registry-url: ${{ secrets.VERDACCIO_URL }}
scope: '@univerjs-pro'
env:
NODE_AUTH_TOKEN: ${{ secrets.VERDACCIO_TOKEN }}

- name: 📦 Build
run: |
pnpm i
pnpm run build
7 changes: 6 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { copyFile, rename, writeFile } from 'node:fs/promises'
import { join, resolve } from 'node:path'
import process from 'node:process'
import { existsSync } from 'node:fs'
import { existsSync, readdirSync } from 'node:fs'
import { defineConfig } from 'vite'
import { univerPlugin } from '@univerjs/vite-plugin'
import builtins from 'builtin-modules'
Expand Down Expand Up @@ -39,6 +39,11 @@ function generate(isDev?: boolean) {

const exchangeWasm = resolve(__dirname, './node_modules/@univerjs-pro/exchange-wasm/package.json')

if (!existsSync(exchangeWasm)) {
// eslint-disable-next-line no-console
console.log('exchange-wasm not found, using mock exchange-wasm')
}

export default defineConfig((_) => {
const dev = process.argv.includes('--watch')

Expand Down

0 comments on commit 40f73e4

Please sign in to comment.