ci: always perform fresh build in deployment job (#5066)

This commit is contained in:
LongYinan 2023-11-28 06:59:50 +00:00
parent aaaed5ac14
commit 0ee2ecc1e9
No known key found for this signature in database
GPG Key ID: 30B1140CE1C07C99
4 changed files with 9 additions and 4 deletions

View File

@ -41,7 +41,7 @@ jobs:
- name: Build Plugins
run: yarn run build:plugins
- name: Build Core
run: yarn nx build @affine/core
run: yarn nx build @affine/core --skip-nx-cache
env:
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}

View File

@ -65,14 +65,15 @@ jobs:
- name: Replace Version
run: ./scripts/set-version.sh ${{ needs.set-build-version.outputs.version }}
- name: generate-assets
working-directory: packages/frontend/electron
run: yarn generate-assets
run: yarn workspace @affine/electron generate-assets
env:
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
NEXT_PUBLIC_SENTRY_DSN: ${{ secrets.NEXT_PUBLIC_SENTRY_DSN }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
RELEASE_VERSION: ${{ needs.set-build-version.outputs.version }}
SKIP_PLUGIN_BUILD: 'true'
SKIP_NX_CACHE: 'true'
- name: Upload core artifact
uses: actions/upload-artifact@v3

View File

@ -67,6 +67,7 @@ jobs:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
RELEASE_VERSION: ${{ github.event.inputs.version || steps.get-canary-version.outputs.RELEASE_VERSION }}
SKIP_PLUGIN_BUILD: 'true'
SKIP_NX_CACHE: 'true'
- name: Upload core artifact
uses: actions/upload-artifact@v3

View File

@ -39,6 +39,9 @@ process.env.DISTRIBUTION = 'desktop';
const cwd = repoRootDir;
const { SKIP_NX_CACHE } = process.env;
const nxFlag = SKIP_NX_CACHE ? '--skip-nx-cache' : '';
if (!process.env.SKIP_PLUGIN_BUILD) {
spawnSync('yarn', ['build:plugins'], {
stdio: 'inherit',
@ -49,7 +52,7 @@ if (!process.env.SKIP_PLUGIN_BUILD) {
// step 1: build web dist
if (!process.env.SKIP_WEB_BUILD) {
spawnSync('yarn', ['nx', 'build', '@affine/core'], {
spawnSync('yarn', ['nx', 'build', '@affine/core', nxFlag], {
stdio: 'inherit',
env: process.env,
cwd,