There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
ci: dynamic setup server deploy environment by release tag (#4790)
LongYinan2d62ec72a701
diff --git a/.github/workflows/build-desktop.yml b/.github/workflows/build-desktop.ymlindex 4d0eaaa23f..6c701f5700 100644--- a/.github/workflows/build-desktop.yml+++ b/.github/workflows/build-desktop.yml@@ -38,7 +38,6 @@ jobs:build-core:name: Build @affine/coreruns-on: ubuntu-latest- environment: developmentsteps:- uses: actions/checkout@v4@@ -58,7 +57,6 @@ jobs:build-native:name: Build Nativeruns-on: ubuntu-latest- environment: developmentneeds: build-coresteps:- uses: actions/checkout@v4@@ -77,7 +75,6 @@ jobs:desktop-test:name: Desktop Testruns-on: ${{ matrix.spec.os }}- environment: developmentstrategy:fail-fast: false# all combinations: macos-latest x64, macos-latest arm64, windows-latest x64, ubuntu-latest x64diff --git a/.github/workflows/build-server.yml b/.github/workflows/build-server.ymlindex 9d84621825..d444a4dd4e 100644--- a/.github/workflows/build-server.yml+++ b/.github/workflows/build-server.yml@@ -39,7 +39,6 @@ jobs:runs-on: ubuntu-latestenv:RUSTFLAGS: '-C debuginfo=1'- environment: developmentsteps:- uses: actions/checkout@v4@@ -66,7 +65,6 @@ jobs:server-test:name: Server Testruns-on: ubuntu-latest- environment: developmentneeds: build-storageservices:postgres:@@ -137,7 +135,6 @@ jobs:server-e2e-test:name: Server E2E Testruns-on: ubuntu-latest- environment: developmentneeds: build-storageservices:postgres:@@ -219,7 +216,6 @@ jobs:server-desktop-e2e-test:name: Server Desktop E2E Testruns-on: ubuntu-latest- environment: developmentneeds: build-storageservices:postgres:diff --git a/.github/workflows/build.yml b/.github/workflows/build.ymlindex e3a3ac28e6..bf200a6a57 100644--- a/.github/workflows/build.yml+++ b/.github/workflows/build.yml@@ -39,7 +39,6 @@ jobs:lint:name: Lintruns-on: ubuntu-latest- environment: developmentsteps:- uses: actions/checkout@v4@@ -75,7 +74,6 @@ jobs:e2e-plugin-test:name: E2E Plugin Testruns-on: ubuntu-latest- environment: developmentsteps:- uses: actions/checkout@v4- name: Setup Node.js@@ -115,7 +113,6 @@ jobs:fail-fast: falsematrix:shard: [1, 2, 3, 4, 5]- environment: developmentsteps:- uses: actions/checkout@v4- name: Setup Node.js@@ -153,7 +150,6 @@ jobs:e2e-migration-test:name: E2E Migration Testruns-on: ubuntu-latest- environment: developmentsteps:- uses: actions/checkout@v4- name: Setup Node.js@@ -176,7 +172,6 @@ jobs:unit-test:name: Unit Testruns-on: ubuntu-latest- environment: developmentsteps:- uses: actions/checkout@v4- name: Setup Node.jsdiff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.ymlindex 01bdefef7e..ce0874e734 100644--- a/.github/workflows/deploy.yml+++ b/.github/workflows/deploy.yml@@ -1,11 +1,6 @@name: Deployon:- push:- branches:- - master- tags:- - 'v[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'workflow_dispatch:inputs:flavor:@@ -200,7 +195,7 @@ jobs:deploy:name: Deploy to cluster- if: ${{ github.event_name == 'workflow_dispatch' || github.ref_type == 'tag' }}+ if: ${{ github.event_name == 'workflow_dispatch' }}environment: ${{ github.event.inputs.flavor }}permissions:contents: 'write'diff --git a/.github/workflows/dispatch-deploy.yml b/.github/workflows/dispatch-deploy.ymlnew file mode 100644index 0000000000..fa58a0a679--- /dev/null+++ b/.github/workflows/dispatch-deploy.yml@@ -0,0 +1,30 @@+name: Dispatch Deploy by tag++on:+ push:+ tags:+ - 'v[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'++jobs:+ dispatch-deploy-by-tag:+ runs-on: ubuntu-latest+ name: Setup deploy environment+ steps:+ - uses: actions/checkout@v4+ - name: Setup Node.js+ uses: ./.github/actions/setup-node+ with:+ extra-flags: 'workspaces focus @affine/monorepo'+ hard-link-nm: false+ electron-install: false+ build-infra: false+ build-plugins: false+ - name: Setup output value+ id: flavor+ run: |+ node -e "const env = require('semver').parse('${{ github.ref_name }}').prerelease[0] ?? 'stable'; console.log(`flavor=${env}`)" >> "$GITHUB_OUTPUT"+ - name: dispatch deploy+ uses: benc-uk/workflow-dispatch@v1+ with:+ workflow: deploy.yml+ inputs: '{ "flavor": "${{ steps.flavor.outputs.flavor }}" }'diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.ymlindex c08dc1c3ce..dbf29c997f 100644--- a/.github/workflows/nightly-build.yml+++ b/.github/workflows/nightly-build.yml@@ -44,7 +44,6 @@ env:jobs:set-build-version:runs-on: ubuntu-latest- environment: productionoutputs:version: 0.0.0-internal.${{ steps.version.outputs.version }}steps:@@ -55,7 +54,6 @@ jobs:before-make:runs-on: ubuntu-latest- environment: productionneeds:- set-build-versionsteps:@@ -83,7 +81,6 @@ jobs:path: packages/frontend/electron/resources/web-staticmake-distribution:- environment: productionstrategy:# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64# For windows, we need a separate approachdiff --git a/.github/workflows/publish-storybook.yml b/.github/workflows/publish-storybook.ymlindex ace6dbc9a7..ca8745ab69 100644--- a/.github/workflows/publish-storybook.yml+++ b/.github/workflows/publish-storybook.yml@@ -22,7 +22,6 @@ jobs:publish-storybook:name: Publish Storybookruns-on: ubuntu-latest- environment: developmentsteps:- uses: actions/checkout@v4with:diff --git a/.github/workflows/release-desktop-app.yml b/.github/workflows/release-desktop-app.ymlindex c231b260cd..6308a7fe00 100644--- a/.github/workflows/release-desktop-app.yml+++ b/.github/workflows/release-desktop-app.yml@@ -40,7 +40,6 @@ env:jobs:before-make:runs-on: ubuntu-latest- environment: productionoutputs:RELEASE_VERSION: ${{ steps.get-canary-version.outputs.RELEASE_VERSION }}steps:@@ -76,7 +75,6 @@ jobs:path: packages/frontend/electron/resources/web-staticmake-distribution:- environment: productionstrategy:# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64# For windows, we need a separate approach@@ -159,7 +157,6 @@ jobs:path: buildspackage-distribution-windows:- environment: productionstrategy:# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64# For windows, we need a separate approach@@ -235,7 +232,6 @@ jobs:artifact-name: packaged-win32-x64make-windows-installer:- environment: productionneeds: sign-packaged-artifacts-windowsstrategy:# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64@@ -289,7 +285,6 @@ jobs:artifact-name: installer-win32-x64finalize-installer-windows:- environment: productionneeds: sign-installer-artifacts-windowsstrategy:# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64