mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-11 20:08:37 +00:00
ci: dynamic setup server deploy environment by release tag (#4790)
This commit is contained in:
3
.github/workflows/build-desktop.yml
vendored
3
.github/workflows/build-desktop.yml
vendored
@@ -38,7 +38,6 @@ jobs:
|
|||||||
build-core:
|
build-core:
|
||||||
name: Build @affine/core
|
name: Build @affine/core
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: development
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -58,7 +57,6 @@ jobs:
|
|||||||
build-native:
|
build-native:
|
||||||
name: Build Native
|
name: Build Native
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: development
|
|
||||||
needs: build-core
|
needs: build-core
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -77,7 +75,6 @@ jobs:
|
|||||||
desktop-test:
|
desktop-test:
|
||||||
name: Desktop Test
|
name: Desktop Test
|
||||||
runs-on: ${{ matrix.spec.os }}
|
runs-on: ${{ matrix.spec.os }}
|
||||||
environment: development
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
# all combinations: macos-latest x64, macos-latest arm64, windows-latest x64, ubuntu-latest x64
|
# all combinations: macos-latest x64, macos-latest arm64, windows-latest x64, ubuntu-latest x64
|
||||||
|
|||||||
4
.github/workflows/build-server.yml
vendored
4
.github/workflows/build-server.yml
vendored
@@ -39,7 +39,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
RUSTFLAGS: '-C debuginfo=1'
|
RUSTFLAGS: '-C debuginfo=1'
|
||||||
environment: development
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -66,7 +65,6 @@ jobs:
|
|||||||
server-test:
|
server-test:
|
||||||
name: Server Test
|
name: Server Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: development
|
|
||||||
needs: build-storage
|
needs: build-storage
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
@@ -137,7 +135,6 @@ jobs:
|
|||||||
server-e2e-test:
|
server-e2e-test:
|
||||||
name: Server E2E Test
|
name: Server E2E Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: development
|
|
||||||
needs: build-storage
|
needs: build-storage
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
@@ -219,7 +216,6 @@ jobs:
|
|||||||
server-desktop-e2e-test:
|
server-desktop-e2e-test:
|
||||||
name: Server Desktop E2E Test
|
name: Server Desktop E2E Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: development
|
|
||||||
needs: build-storage
|
needs: build-storage
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
|
|||||||
5
.github/workflows/build.yml
vendored
5
.github/workflows/build.yml
vendored
@@ -39,7 +39,6 @@ jobs:
|
|||||||
lint:
|
lint:
|
||||||
name: Lint
|
name: Lint
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: development
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -75,7 +74,6 @@ jobs:
|
|||||||
e2e-plugin-test:
|
e2e-plugin-test:
|
||||||
name: E2E Plugin Test
|
name: E2E Plugin Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: development
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
@@ -115,7 +113,6 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
shard: [1, 2, 3, 4, 5]
|
shard: [1, 2, 3, 4, 5]
|
||||||
environment: development
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
@@ -153,7 +150,6 @@ jobs:
|
|||||||
e2e-migration-test:
|
e2e-migration-test:
|
||||||
name: E2E Migration Test
|
name: E2E Migration Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: development
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
@@ -176,7 +172,6 @@ jobs:
|
|||||||
unit-test:
|
unit-test:
|
||||||
name: Unit Test
|
name: Unit Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: development
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
|
|||||||
7
.github/workflows/deploy.yml
vendored
7
.github/workflows/deploy.yml
vendored
@@ -1,11 +1,6 @@
|
|||||||
name: Deploy
|
name: Deploy
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
tags:
|
|
||||||
- 'v[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
flavor:
|
flavor:
|
||||||
@@ -200,7 +195,7 @@ jobs:
|
|||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy to cluster
|
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 }}
|
environment: ${{ github.event.inputs.flavor }}
|
||||||
permissions:
|
permissions:
|
||||||
contents: 'write'
|
contents: 'write'
|
||||||
|
|||||||
30
.github/workflows/dispatch-deploy.yml
vendored
Normal file
30
.github/workflows/dispatch-deploy.yml
vendored
Normal file
@@ -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 }}" }'
|
||||||
3
.github/workflows/nightly-build.yml
vendored
3
.github/workflows/nightly-build.yml
vendored
@@ -44,7 +44,6 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
set-build-version:
|
set-build-version:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: production
|
|
||||||
outputs:
|
outputs:
|
||||||
version: 0.0.0-internal.${{ steps.version.outputs.version }}
|
version: 0.0.0-internal.${{ steps.version.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
@@ -55,7 +54,6 @@ jobs:
|
|||||||
|
|
||||||
before-make:
|
before-make:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: production
|
|
||||||
needs:
|
needs:
|
||||||
- set-build-version
|
- set-build-version
|
||||||
steps:
|
steps:
|
||||||
@@ -83,7 +81,6 @@ jobs:
|
|||||||
path: packages/frontend/electron/resources/web-static
|
path: packages/frontend/electron/resources/web-static
|
||||||
|
|
||||||
make-distribution:
|
make-distribution:
|
||||||
environment: production
|
|
||||||
strategy:
|
strategy:
|
||||||
# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64
|
# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64
|
||||||
# For windows, we need a separate approach
|
# For windows, we need a separate approach
|
||||||
|
|||||||
1
.github/workflows/publish-storybook.yml
vendored
1
.github/workflows/publish-storybook.yml
vendored
@@ -22,7 +22,6 @@ jobs:
|
|||||||
publish-storybook:
|
publish-storybook:
|
||||||
name: Publish Storybook
|
name: Publish Storybook
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: development
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
5
.github/workflows/release-desktop-app.yml
vendored
5
.github/workflows/release-desktop-app.yml
vendored
@@ -40,7 +40,6 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
before-make:
|
before-make:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: production
|
|
||||||
outputs:
|
outputs:
|
||||||
RELEASE_VERSION: ${{ steps.get-canary-version.outputs.RELEASE_VERSION }}
|
RELEASE_VERSION: ${{ steps.get-canary-version.outputs.RELEASE_VERSION }}
|
||||||
steps:
|
steps:
|
||||||
@@ -76,7 +75,6 @@ jobs:
|
|||||||
path: packages/frontend/electron/resources/web-static
|
path: packages/frontend/electron/resources/web-static
|
||||||
|
|
||||||
make-distribution:
|
make-distribution:
|
||||||
environment: production
|
|
||||||
strategy:
|
strategy:
|
||||||
# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64
|
# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64
|
||||||
# For windows, we need a separate approach
|
# For windows, we need a separate approach
|
||||||
@@ -159,7 +157,6 @@ jobs:
|
|||||||
path: builds
|
path: builds
|
||||||
|
|
||||||
package-distribution-windows:
|
package-distribution-windows:
|
||||||
environment: production
|
|
||||||
strategy:
|
strategy:
|
||||||
# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64
|
# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64
|
||||||
# For windows, we need a separate approach
|
# For windows, we need a separate approach
|
||||||
@@ -235,7 +232,6 @@ jobs:
|
|||||||
artifact-name: packaged-win32-x64
|
artifact-name: packaged-win32-x64
|
||||||
|
|
||||||
make-windows-installer:
|
make-windows-installer:
|
||||||
environment: production
|
|
||||||
needs: sign-packaged-artifacts-windows
|
needs: sign-packaged-artifacts-windows
|
||||||
strategy:
|
strategy:
|
||||||
# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64
|
# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64
|
||||||
@@ -289,7 +285,6 @@ jobs:
|
|||||||
artifact-name: installer-win32-x64
|
artifact-name: installer-win32-x64
|
||||||
|
|
||||||
finalize-installer-windows:
|
finalize-installer-windows:
|
||||||
environment: production
|
|
||||||
needs: sign-installer-artifacts-windows
|
needs: sign-installer-artifacts-windows
|
||||||
strategy:
|
strategy:
|
||||||
# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64
|
# all combinations: macos-latest x64, macos-latest arm64, ubuntu-latest x64
|
||||||
|
|||||||
Reference in New Issue
Block a user