mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 02:42:25 +08:00
Compare commits
1 Commits
v0.26.3
...
v0.11.0-ca
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1274e0b6ab |
20
.github/actions/setup-version/action.yml
vendored
Normal file
20
.github/actions/setup-version/action.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
name: Setup Version
|
||||||
|
description: 'Setup Version'
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: 'Write Version'
|
||||||
|
id: version
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
if [ "${{ github.ref_type }}" == "tag" ]; then
|
||||||
|
APP_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
|
||||||
|
else
|
||||||
|
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
||||||
|
TIME_VERSION=$(date +%Y%m%d%H%M)
|
||||||
|
GIT_SHORT_HASH=$(git rev-parse --short HEAD)
|
||||||
|
APP_VERSION=$PACKAGE_VERSION-nightly-$TIME_VERSION-$GIT_SHORT_HASH
|
||||||
|
fi
|
||||||
|
echo $APP_VERSION
|
||||||
|
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
./scripts/set-version.sh $APP_VERSION
|
||||||
27
.github/workflows/deploy-automatically.yml
vendored
Normal file
27
.github/workflows/deploy-automatically.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
name: Dispatch Deploy by tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'
|
||||||
|
schedule:
|
||||||
|
- cron: '0 7 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dispatch-deploy-by-tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Setup deploy environment
|
||||||
|
steps:
|
||||||
|
- name: dispatch deploy by tag
|
||||||
|
if: ${{ github.event == 'push' }}
|
||||||
|
uses: benc-uk/workflow-dispatch@v1
|
||||||
|
with:
|
||||||
|
workflow: deploy.yml
|
||||||
|
inputs: '{ "flavor": "canary" }'
|
||||||
|
- name: dispatch deploy by schedule
|
||||||
|
if: ${{ github.event == 'schedule' }}
|
||||||
|
uses: benc-uk/workflow-dispatch@v1
|
||||||
|
with:
|
||||||
|
workflow: deploy.yml
|
||||||
|
inputs: '{ "flavor": "canary" }'
|
||||||
|
ref: canary
|
||||||
26
.github/workflows/deploy.yml
vendored
26
.github/workflows/deploy.yml
vendored
@@ -4,10 +4,14 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
flavor:
|
flavor:
|
||||||
description: 'Build type (canary, beta, or stable or internal)'
|
description: 'Select what enverionment to deploy to'
|
||||||
type: string
|
type: choice
|
||||||
default: canary
|
default: canary
|
||||||
|
options:
|
||||||
|
- canary
|
||||||
|
- beta
|
||||||
|
- stable
|
||||||
|
- internal
|
||||||
env:
|
env:
|
||||||
APP_NAME: affine
|
APP_NAME: affine
|
||||||
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
|
||||||
@@ -18,6 +22,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Version
|
||||||
|
uses: ./.github/actions/setup-version
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
with:
|
with:
|
||||||
@@ -36,6 +42,8 @@ jobs:
|
|||||||
environment: ${{ github.event.inputs.flavor }}
|
environment: ${{ github.event.inputs.flavor }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Version
|
||||||
|
uses: ./.github/actions/setup-version
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
- name: Build Plugins
|
- name: Build Plugins
|
||||||
@@ -67,6 +75,8 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Version
|
||||||
|
uses: ./.github/actions/setup-version
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
- name: Build Rust
|
- name: Build Rust
|
||||||
@@ -88,6 +98,8 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Version
|
||||||
|
uses: ./.github/actions/setup-version
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
- name: Build Rust
|
- name: Build Rust
|
||||||
@@ -207,12 +219,8 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: setup deploy version
|
- name: Setup Version
|
||||||
id: version
|
uses: ./.github/actions/setup-version
|
||||||
run: |
|
|
||||||
export APP_VERSION=`node -e "console.log(require('./package.json').version)"`
|
|
||||||
echo $APP_VERSION
|
|
||||||
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Deploy to ${{ github.event.inputs.flavor }}
|
- name: Deploy to ${{ github.event.inputs.flavor }}
|
||||||
uses: ./.github/actions/deploy
|
uses: ./.github/actions/deploy
|
||||||
with:
|
with:
|
||||||
|
|||||||
30
.github/workflows/dispatch-deploy.yml
vendored
30
.github/workflows/dispatch-deploy.yml
vendored
@@ -1,30 +0,0 @@
|
|||||||
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 }}" }'
|
|
||||||
27
.github/workflows/release-desktop-automatically.yml
vendored
Normal file
27
.github/workflows/release-desktop-automatically.yml
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
name: Dispatch Release Desktop by tag
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'
|
||||||
|
schedule:
|
||||||
|
- cron: '0 7 * * *'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
dispatch-desktop-app-by-tag:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
name: Setup Release Desktop
|
||||||
|
steps:
|
||||||
|
- name: dispatch desktop release by tag
|
||||||
|
if: ${{ github.event == 'push' }}
|
||||||
|
uses: benc-uk/workflow-dispatch@v1
|
||||||
|
with:
|
||||||
|
workflow: release-desktop.yml
|
||||||
|
inputs: '{ "build-type": "canary", "is-draft": true, "is-pre-release": true }'
|
||||||
|
- name: dispatch desktop release by schedule
|
||||||
|
if: ${{ github.event == 'schedule' }}
|
||||||
|
uses: benc-uk/workflow-dispatch@v1
|
||||||
|
with:
|
||||||
|
workflow: release-desktop.yml
|
||||||
|
inputs: '{ "build-type": "canary", "is-draft": true, "is-pre-release": true }'
|
||||||
|
ref: canary
|
||||||
@@ -1,15 +1,17 @@
|
|||||||
name: Release Desktop App
|
name: Release Desktop App
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- 'v[0-9]+.[0-9]+.[0-9]+-canary.[0-9]+'
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
build-type:
|
||||||
description: App Version
|
description: 'Build Type'
|
||||||
|
type: choice
|
||||||
required: true
|
required: true
|
||||||
default: 0.0.0
|
default: canary
|
||||||
|
options:
|
||||||
|
- canary
|
||||||
|
- beta
|
||||||
|
- stable
|
||||||
is-draft:
|
is-draft:
|
||||||
description: 'Draft Release?'
|
description: 'Draft Release?'
|
||||||
type: boolean
|
type: boolean
|
||||||
@@ -20,11 +22,6 @@ on:
|
|||||||
type: boolean
|
type: boolean
|
||||||
required: true
|
required: true
|
||||||
default: true
|
default: true
|
||||||
build-type:
|
|
||||||
description: 'Build Type (canary, beta or stable)'
|
|
||||||
type: string
|
|
||||||
required: true
|
|
||||||
default: canary
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
actions: write
|
actions: write
|
||||||
@@ -32,7 +29,7 @@ permissions:
|
|||||||
security-events: write
|
security-events: write
|
||||||
|
|
||||||
env:
|
env:
|
||||||
BUILD_TYPE: ${{ github.event.inputs.build-type || (github.ref_type == 'tag' && contains(github.ref, 'canary') && 'canary') }}
|
BUILD_TYPE: ${{ github.event.inputs.build-type }}
|
||||||
DEBUG: napi:*
|
DEBUG: napi:*
|
||||||
APP_NAME: affine
|
APP_NAME: affine
|
||||||
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
||||||
@@ -40,26 +37,17 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
before-make:
|
before-make:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment: ${{ github.event.inputs.build-type || (github.ref_type == 'tag' && contains(github.ref, 'canary') && 'canary') }}
|
environment: ${{ github.event.inputs.build-type }}
|
||||||
outputs:
|
outputs:
|
||||||
RELEASE_VERSION: ${{ steps.get-canary-version.outputs.RELEASE_VERSION }}
|
RELEASE_VERSION: ${{ steps.version.outputs.APP_VERSION }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
- name: Setup Version
|
||||||
|
uses: ./.github/actions/setup-version
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: ./.github/actions/setup-node
|
uses: ./.github/actions/setup-node
|
||||||
- name: Setup @sentry/cli
|
- name: Setup @sentry/cli
|
||||||
uses: ./.github/actions/setup-sentry
|
uses: ./.github/actions/setup-sentry
|
||||||
- name: Get canary version
|
|
||||||
id: get-canary-version
|
|
||||||
if: ${{ github.ref_type == 'tag' }}
|
|
||||||
run: |
|
|
||||||
TAG_VERSION=${GITHUB_REF#refs/tags/v}
|
|
||||||
PACKAGE_VERSION=$(node -p "require('./packages/frontend/electron/package.json').version")
|
|
||||||
if [ "$TAG_VERSION" != "$PACKAGE_VERSION" ]; then
|
|
||||||
echo "Tag version ($TAG_VERSION) does not match package.json version ($PACKAGE_VERSION)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
echo "RELEASE_VERSION=$(node -p "require('./packages/frontend/electron/package.json').version")" >> $GITHUB_OUTPUT
|
|
||||||
- name: generate-assets
|
- name: generate-assets
|
||||||
run: yarn workspace @affine/electron generate-assets
|
run: yarn workspace @affine/electron generate-assets
|
||||||
env:
|
env:
|
||||||
@@ -67,7 +55,7 @@ jobs:
|
|||||||
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
||||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||||
RELEASE_VERSION: ${{ github.event.inputs.version || steps.get-canary-version.outputs.RELEASE_VERSION }}
|
RELEASE_VERSION: ${{ steps.version.outputs.APP_VERSION }}
|
||||||
SKIP_PLUGIN_BUILD: 'true'
|
SKIP_PLUGIN_BUILD: 'true'
|
||||||
SKIP_NX_CACHE: 'true'
|
SKIP_NX_CACHE: 'true'
|
||||||
|
|
||||||
@@ -361,14 +349,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
node ./packages/frontend/electron/scripts/generate-yml.js
|
node ./packages/frontend/electron/scripts/generate-yml.js
|
||||||
env:
|
env:
|
||||||
RELEASE_VERSION: ${{ github.event.inputs.version || needs.before-make.outputs.RELEASE_VERSION }}
|
RELEASE_VERSION: ${{ needs.before-make.outputs.RELEASE_VERSION }}
|
||||||
- name: Create Release Draft
|
- name: Create Release Draft
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
name: ${{ github.event.inputs.version || needs.before-make.outputs.RELEASE_VERSION }}
|
name: ${{ needs.before-make.outputs.RELEASE_VERSION }}
|
||||||
body: ''
|
body: ''
|
||||||
draft: ${{ github.event.inputs.is-draft || true }}
|
draft: ${{ github.event.inputs.is-draft || true }}
|
||||||
prerelease: ${{ github.event.inputs.is-pre-release || needs.before-make.outputs.version }}
|
prerelease: ${{ github.event.inputs.is-pre-release || true }}
|
||||||
files: |
|
files: |
|
||||||
./VERSION
|
./VERSION
|
||||||
./*.zip
|
./*.zip
|
||||||
Reference in New Issue
Block a user