build: fix nx config (#2824)

This commit is contained in:
Alex Yang
2023-06-19 23:07:40 +08:00
committed by GitHub
parent 357ff9853d
commit 775d6212d3
2 changed files with 30 additions and 29 deletions

View File

@@ -29,6 +29,7 @@ env:
APP_NAME: affine
COVERAGE: true
MACOSX_DEPLOYMENT_TARGET: '10.13'
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
jobs:
lint:
@@ -70,29 +71,20 @@ jobs:
name: Build @affine/web
runs-on: ubuntu-latest
environment: development
env:
API_SERVER_PROFILE: local
ENABLE_DEBUG_PAGE: 1
ENABLE_PLUGIN: true
ENABLE_ALL_PAGE_FILTER: true
ENABLE_LEGACY_PROVIDER: true
ENABLE_PRELOADING: false
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Cache Next.js
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/apps/web/.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
- name: Build Web
run: yarn nx build @affine/web
env:
API_SERVER_PROFILE: local
ENABLE_DEBUG_PAGE: 1
ENABLE_PLUGIN: true
ENABLE_ALL_PAGE_FILTER: true
ENABLE_LEGACY_PROVIDER: true
ENABLE_PRELOADING: false
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
@@ -100,19 +92,25 @@ jobs:
path: ./apps/web/.next
if-no-files-found: error
- name: Build Web (Desktop)
run: yarn nx build @affine/web
env:
API_SERVER_PROFILE: affine
ENABLE_DEBUG_PAGE: 1
ENABLE_PLUGIN: true
ENABLE_ALL_PAGE_FILTER: true
ENABLE_LEGACY_PROVIDER: false
ENABLE_PRELOADING: false
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
build-web-desktop:
name: Build @affine/web (Desktop)
runs-on: ubuntu-latest
environment: development
env:
API_SERVER_PROFILE: affine
ENABLE_DEBUG_PAGE: 1
ENABLE_PLUGIN: true
ENABLE_ALL_PAGE_FILTER: true
ENABLE_LEGACY_PROVIDER: false
ENABLE_PRELOADING: false
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Export static resources
run: yarn workspace @affine/web export
run: yarn nx export @affine/web
- name: Upload static resources artifact
uses: actions/upload-artifact@v3
@@ -297,7 +295,7 @@ jobs:
target: x86_64-pc-windows-msvc,
test: true,
}
needs: [build-web]
needs: [build-web-desktop]
steps:
- uses: actions/checkout@v3
- name: Setup Node.js