build: fix nx config (#2824)
This commit is contained in:
54
.github/workflows/build.yml
vendored
54
.github/workflows/build.yml
vendored
@@ -29,6 +29,7 @@ env:
|
|||||||
APP_NAME: affine
|
APP_NAME: affine
|
||||||
COVERAGE: true
|
COVERAGE: true
|
||||||
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
||||||
|
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
@@ -70,29 +71,20 @@ jobs:
|
|||||||
name: Build @affine/web
|
name: Build @affine/web
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: development
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: ./.github/actions/setup-node
|
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
|
- name: Build Web
|
||||||
run: yarn nx build @affine/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
|
- name: Upload artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -100,19 +92,25 @@ jobs:
|
|||||||
path: ./apps/web/.next
|
path: ./apps/web/.next
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Build Web (Desktop)
|
build-web-desktop:
|
||||||
run: yarn nx build @affine/web
|
name: Build @affine/web (Desktop)
|
||||||
env:
|
runs-on: ubuntu-latest
|
||||||
API_SERVER_PROFILE: affine
|
environment: development
|
||||||
ENABLE_DEBUG_PAGE: 1
|
env:
|
||||||
ENABLE_PLUGIN: true
|
API_SERVER_PROFILE: affine
|
||||||
ENABLE_ALL_PAGE_FILTER: true
|
ENABLE_DEBUG_PAGE: 1
|
||||||
ENABLE_LEGACY_PROVIDER: false
|
ENABLE_PLUGIN: true
|
||||||
ENABLE_PRELOADING: false
|
ENABLE_ALL_PAGE_FILTER: true
|
||||||
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
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
|
- name: Export static resources
|
||||||
run: yarn workspace @affine/web export
|
run: yarn nx export @affine/web
|
||||||
|
|
||||||
- name: Upload static resources artifact
|
- name: Upload static resources artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
@@ -297,7 +295,7 @@ jobs:
|
|||||||
target: x86_64-pc-windows-msvc,
|
target: x86_64-pc-windows-msvc,
|
||||||
test: true,
|
test: true,
|
||||||
}
|
}
|
||||||
needs: [build-web]
|
needs: [build-web-desktop]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
|||||||
5
nx.json
5
nx.json
@@ -29,7 +29,7 @@
|
|||||||
"{projectRoot}/build",
|
"{projectRoot}/build",
|
||||||
"{projectRoot}/out",
|
"{projectRoot}/out",
|
||||||
"{projectRoot}/node_modules/.cache",
|
"{projectRoot}/node_modules/.cache",
|
||||||
"apps/web/.next/cache",
|
"apps/web/.next",
|
||||||
"packages/storybook/storybook-static",
|
"packages/storybook/storybook-static",
|
||||||
"packages/native/affine.*.node"
|
"packages/native/affine.*.node"
|
||||||
],
|
],
|
||||||
@@ -83,6 +83,9 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"export": {
|
||||||
|
"dependsOn": ["build"]
|
||||||
|
},
|
||||||
"dev": {
|
"dev": {
|
||||||
"dependsOn": ["^build"]
|
"dependsOn": ["^build"]
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user