mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 18:09:58 +08:00
1f58173800
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/checkout](https://redirect.github.com/actions/checkout) | action | major | `v6` → `v7` | --- ### Release Notes <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v7.0.1`](https://redirect.github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v701) [Compare Source](https://redirect.github.com/actions/checkout/compare/v7.0.0...v7.0.1) - Bump github/codeql-action from 3 to 4 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2475](https://redirect.github.com/actions/checkout/pull/2475) - Bump actions/setup-node from 4 to 6 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2477](https://redirect.github.com/actions/checkout/pull/2477) - Bump docker/build-push-action from 6.5.0 to 7.2.0 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2478](https://redirect.github.com/actions/checkout/pull/2478) - Bump docker/login-action from 3.3.0 to 4.2.0 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2479](https://redirect.github.com/actions/checkout/pull/2479) - Bump actions/checkout from 6 to 7 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2488](https://redirect.github.com/actions/checkout/pull/2488) - Bump actions/upload-artifact from 4 to 7 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2476](https://redirect.github.com/actions/checkout/pull/2476) - eslint 9 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2474](https://redirect.github.com/actions/checkout/pull/2474) - Bump the minor-actions-dependencies group with 2 updates by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2499](https://redirect.github.com/actions/checkout/pull/2499) - skip running unsafe pr check if input is default by [@​aiqiaoy](https://redirect.github.com/aiqiaoy) in [#​2518](https://redirect.github.com/actions/checkout/pull/2518) - trim only ascii whitespace for branch by [@​aiqiaoy](https://redirect.github.com/aiqiaoy) in [#​2521](https://redirect.github.com/actions/checkout/pull/2521) - escape values passed to --unset by [@​aiqiaoy](https://redirect.github.com/aiqiaoy) in [#​2530](https://redirect.github.com/actions/checkout/pull/2530) ### [`v7.0.0`](https://redirect.github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v700) [Compare Source](https://redirect.github.com/actions/checkout/compare/v7.0.0...v7.0.0) - Block checking out fork PR for pull\_request\_target and workflow\_run by [@​aiqiaoy](https://redirect.github.com/aiqiaoy) in [#​2454](https://redirect.github.com/actions/checkout/pull/2454) - Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2458](https://redirect.github.com/actions/checkout/pull/2458) - Bump flatted from 3.3.1 to 3.4.2 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2460](https://redirect.github.com/actions/checkout/pull/2460) - Bump js-yaml from 4.1.0 to 4.2.0 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2461](https://redirect.github.com/actions/checkout/pull/2461) - Bump [@​actions/core](https://redirect.github.com/actions/core) and [@​actions/tool-cache](https://redirect.github.com/actions/tool-cache) and Remove uuid by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2459](https://redirect.github.com/actions/checkout/pull/2459) - upgrade module to esm and update dependencies by [@​aiqiaoy](https://redirect.github.com/aiqiaoy) in [#​2463](https://redirect.github.com/actions/checkout/pull/2463) - Bump the minor-npm-dependencies group across 1 directory with 3 updates by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2462](https://redirect.github.com/actions/checkout/pull/2462) ### [`v7`](https://redirect.github.com/actions/checkout/blob/HEAD/CHANGELOG.md#v700) [Compare Source](https://redirect.github.com/actions/checkout/compare/v6.1.0...v7.0.0) - Block checking out fork PR for pull\_request\_target and workflow\_run by [@​aiqiaoy](https://redirect.github.com/aiqiaoy) in [#​2454](https://redirect.github.com/actions/checkout/pull/2454) - Bump actions/publish-immutable-action from 0.0.3 to 0.0.4 in the minor-actions-dependencies group across 1 directory by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2458](https://redirect.github.com/actions/checkout/pull/2458) - Bump flatted from 3.3.1 to 3.4.2 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2460](https://redirect.github.com/actions/checkout/pull/2460) - Bump js-yaml from 4.1.0 to 4.2.0 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2461](https://redirect.github.com/actions/checkout/pull/2461) - Bump [@​actions/core](https://redirect.github.com/actions/core) and [@​actions/tool-cache](https://redirect.github.com/actions/tool-cache) and Remove uuid by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2459](https://redirect.github.com/actions/checkout/pull/2459) - upgrade module to esm and update dependencies by [@​aiqiaoy](https://redirect.github.com/aiqiaoy) in [#​2463](https://redirect.github.com/actions/checkout/pull/2463) - Bump the minor-npm-dependencies group across 1 directory with 3 updates by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​2462](https://redirect.github.com/actions/checkout/pull/2462) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/toeverything/AFFiNE). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4zLjIiLCJ1cGRhdGVkSW5WZXIiOiI0NC4zLjIiLCJ0YXJnZXRCcmFuY2giOiJjYW5hcnkiLCJsYWJlbHMiOlsiZGVwZW5kZW5jaWVzIl19--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
273 lines
8.8 KiB
YAML
273 lines
8.8 KiB
YAML
name: Build Images
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
build-type:
|
|
type: string
|
|
required: true
|
|
app-version:
|
|
type: string
|
|
required: true
|
|
git-short-hash:
|
|
type: string
|
|
required: true
|
|
|
|
permissions:
|
|
contents: 'write'
|
|
id-token: 'write'
|
|
packages: 'write'
|
|
|
|
jobs:
|
|
build-web:
|
|
name: Build @affine/web
|
|
runs-on: ubuntu-latest
|
|
environment: ${{ inputs.build-type }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Setup Version
|
|
uses: ./.github/actions/setup-version
|
|
with:
|
|
app-version: ${{ inputs.app-version }}
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
- name: Build Core
|
|
run: yarn affine @affine/web build
|
|
env:
|
|
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
|
|
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
|
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
|
BUILD_TYPE: ${{ inputs.build-type }}
|
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
|
SENTRY_PROJECT: 'affine-web'
|
|
SENTRY_RELEASE: ${{ inputs.app-version }}
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
|
PERFSEE_TOKEN: ${{ secrets.PERFSEE_TOKEN }}
|
|
- name: Upload web artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: web
|
|
path: ./packages/frontend/apps/web/dist
|
|
if-no-files-found: error
|
|
|
|
build-admin:
|
|
name: Build @affine/admin
|
|
runs-on: ubuntu-latest
|
|
environment: ${{ inputs.build-type }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Setup Version
|
|
uses: ./.github/actions/setup-version
|
|
with:
|
|
app-version: ${{ inputs.app-version }}
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
- name: Build Admin
|
|
run: yarn affine @affine/admin build
|
|
env:
|
|
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
|
|
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
|
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
|
BUILD_TYPE: ${{ inputs.build-type }}
|
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
|
SENTRY_PROJECT: 'affine-admin'
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
|
PERFSEE_TOKEN: ${{ secrets.PERFSEE_TOKEN }}
|
|
- name: Upload admin artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: admin
|
|
path: ./packages/frontend/admin/dist
|
|
if-no-files-found: error
|
|
|
|
build-mobile:
|
|
name: Build @affine/mobile
|
|
runs-on: ubuntu-latest
|
|
environment: ${{ inputs.build-type }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Setup Version
|
|
uses: ./.github/actions/setup-version
|
|
with:
|
|
app-version: ${{ inputs.app-version }}
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
- name: Build Mobile
|
|
run: yarn affine @affine/mobile build
|
|
env:
|
|
R2_ACCOUNT_ID: ${{ secrets.R2_ACCOUNT_ID }}
|
|
R2_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
|
|
R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}
|
|
BUILD_TYPE: ${{ inputs.build-type }}
|
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
|
SENTRY_PROJECT: 'affine-mobile'
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
|
PERFSEE_TOKEN: ${{ secrets.PERFSEE_TOKEN }}
|
|
- name: Upload mobile artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: mobile
|
|
path: ./packages/frontend/apps/mobile/dist
|
|
if-no-files-found: error
|
|
|
|
build-server-native:
|
|
name: Build Server native - ${{ matrix.targets.name }}
|
|
runs-on: ubuntu-22.04
|
|
environment: ${{ inputs.build-type }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
targets:
|
|
- name: x86_64-unknown-linux-gnu
|
|
file: server-native.x64.node
|
|
- name: aarch64-unknown-linux-gnu
|
|
file: server-native.arm64.node
|
|
- name: armv7-unknown-linux-gnueabihf
|
|
file: server-native.armv7.node
|
|
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Setup Version
|
|
uses: ./.github/actions/setup-version
|
|
with:
|
|
app-version: ${{ inputs.app-version }}
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
with:
|
|
electron-install: false
|
|
extra-flags: workspaces focus @affine/server-native
|
|
- name: Build Rust
|
|
uses: ./.github/actions/build-rust
|
|
env:
|
|
AFFINE_PRO_PUBLIC_KEY: ${{ secrets.AFFINE_PRO_PUBLIC_KEY }}
|
|
AFFINE_PRO_LICENSE_AES_KEY: ${{ secrets.AFFINE_PRO_LICENSE_AES_KEY }}
|
|
with:
|
|
target: ${{ matrix.targets.name }}
|
|
package: '@affine/server-native'
|
|
- name: Rename ${{ matrix.targets.file }}
|
|
run: |
|
|
mv ./packages/backend/native/server-native.node ./packages/backend/native/${{ matrix.targets.file }}
|
|
- name: Upload ${{ matrix.targets.file }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: server-native-${{ matrix.targets.file }}
|
|
path: ./packages/backend/native/${{ matrix.targets.file }}
|
|
if-no-files-found: error
|
|
|
|
build-server:
|
|
name: Build Server
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- build-server-native
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Setup Version
|
|
uses: ./.github/actions/setup-version
|
|
with:
|
|
app-version: ${{ inputs.app-version }}
|
|
- name: Setup Node.js
|
|
uses: ./.github/actions/setup-node
|
|
with:
|
|
electron-install: false
|
|
extra-flags: workspaces focus @affine/server @types/affine__env
|
|
- name: Download server-native
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
pattern: server-native-*
|
|
merge-multiple: true
|
|
path: ./packages/backend/native
|
|
- name: List server-native files
|
|
run: ls -alh ./packages/backend/native
|
|
- name: Build Server
|
|
run: yarn workspace @affine/server build
|
|
- name: Upload server dist
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: server-dist
|
|
path: ./packages/backend/server/dist
|
|
if-no-files-found: error
|
|
|
|
build-images:
|
|
name: Build Images
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- build-server
|
|
- build-web
|
|
- build-mobile
|
|
- build-admin
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Download server dist
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: server-dist
|
|
path: ./packages/backend/server/dist
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ghcr.io
|
|
logout: false
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
# setup node without cache configuration
|
|
# Prisma cache is not compatible with docker build cache
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
registry-url: https://npm.pkg.github.com
|
|
scope: '@toeverything'
|
|
|
|
- name: Download web artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: web
|
|
path: ./packages/frontend/apps/web/dist
|
|
|
|
- name: Download mobile artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: mobile
|
|
path: ./packages/frontend/apps/mobile/dist
|
|
|
|
- name: Download admin artifact
|
|
uses: actions/download-artifact@v4
|
|
with:
|
|
name: admin
|
|
path: ./packages/frontend/admin/dist
|
|
|
|
- name: Install Node.js dependencies
|
|
run: |
|
|
yarn config set --json supportedArchitectures.cpu '["x64", "arm64", "arm"]'
|
|
yarn config set --json supportedArchitectures.libc '["glibc"]'
|
|
yarn workspaces focus @affine/server --production
|
|
|
|
- name: Generate Prisma client
|
|
run: yarn workspace @affine/server prisma generate
|
|
|
|
- name: Mv node_modules
|
|
run: mv ./node_modules ./packages/backend/server
|
|
|
|
- name: Setup Version
|
|
uses: ./.github/actions/setup-version
|
|
with:
|
|
app-version: ${{ inputs.app-version }}
|
|
|
|
- name: Build backend Dockerfile
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: .
|
|
push: true
|
|
pull: true
|
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
|
provenance: true
|
|
file: .github/deployment/node/Dockerfile
|
|
tags: ghcr.io/toeverything/affine:${{inputs.build-type}}-${{ inputs.git-short-hash }}
|