mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
ci: group cloud, desktop, mobile in one release workflow (#12802)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced new workflows for preparing releases, cloud deployment, and coordinated multi-platform releases with manual approval for stable Docker images. - Added a reusable action to output app version, Git hash, and build type for consistent release metadata. - **Refactor** - Simplified and unified input handling across workflows, requiring explicit version and build metadata inputs. - Updated release workflows (desktop, mobile, cloud) to use direct inputs instead of deriving values internally. - **Chores** - Removed several legacy and redundant workflows, including automatic deployment, release, label checking, auto-assign, and Helm chart publishing. - Deleted jobs and workflows related to self-hosted image builds, mobile app test builds, and previous deployment processes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
5
.github/actions/deploy/action.yml
vendored
5
.github/actions/deploy/action.yml
vendored
@@ -1,9 +1,6 @@
|
||||
name: 'Deploy to Cluster'
|
||||
description: 'Deploy AFFiNE Cloud to cluster'
|
||||
inputs:
|
||||
build-type:
|
||||
description: 'Align with App build type, canary|beta|stable|internal'
|
||||
default: 'canary'
|
||||
gcp-project-number:
|
||||
description: 'GCP project number'
|
||||
required: true
|
||||
@@ -36,5 +33,3 @@ runs:
|
||||
- name: Deploy
|
||||
shell: bash
|
||||
run: node ./.github/actions/deploy/deploy.mjs
|
||||
env:
|
||||
BUILD_TYPE: '${{ inputs.build-type }}'
|
||||
|
||||
42
.github/actions/prepare-release/action.yml
vendored
Normal file
42
.github/actions/prepare-release/action.yml
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
name: Prepare Release
|
||||
description: 'Prepare Release'
|
||||
outputs:
|
||||
APP_VERSION:
|
||||
description: 'App Version'
|
||||
value: ${{ steps.get-version.outputs.APP_VERSION }}
|
||||
GIT_SHORT_HASH:
|
||||
description: 'Git Short Hash'
|
||||
value: ${{ steps.get-version.outputs.GIT_SHORT_HASH }}
|
||||
BUILD_TYPE:
|
||||
description: 'Build Type'
|
||||
value: ${{ steps.get-version.outputs.BUILD_TYPE }}
|
||||
runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Get Version
|
||||
id: get-version
|
||||
shell: bash
|
||||
run: |
|
||||
GIT_SHORT_HASH=$(git rev-parse --short HEAD)
|
||||
if [ "${{ github.ref_type }}" == "tag" ]; then
|
||||
APP_VERSION=$(echo "${{ github.ref_name }}" | sed 's/^v//')
|
||||
else
|
||||
PACKAGE_VERSION=$(node -p "require('./package.json').version")
|
||||
APP_VERSION=$PACKAGE_VERSION-canary.$GIT_SHORT_HASH
|
||||
fi
|
||||
if [[ "$APP_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
BUILD_TYPE=stable
|
||||
elif [[ "$APP_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-beta\.[0-9]+$ ]]; then
|
||||
BUILD_TYPE=beta
|
||||
elif [[ "$APP_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-canary\.[0-9a-f]+$ ]]; then
|
||||
BUILD_TYPE=canary
|
||||
else
|
||||
echo "Error: unsupported version string: $APP_VERSION" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo $APP_VERSION
|
||||
echo $GIT_SHORT_HASH
|
||||
echo $BUILD_TYPE
|
||||
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_OUTPUT"
|
||||
echo "GIT_SHORT_HASH=$GIT_SHORT_HASH" >> "$GITHUB_OUTPUT"
|
||||
echo "BUILD_TYPE=$BUILD_TYPE" >> "$GITHUB_OUTPUT"
|
||||
20
.github/actions/setup-version/action.yml
vendored
20
.github/actions/setup-version/action.yml
vendored
@@ -1,24 +1,12 @@
|
||||
name: Setup Version
|
||||
description: 'Setup Version'
|
||||
outputs:
|
||||
APP_VERSION:
|
||||
inputs:
|
||||
app-version:
|
||||
description: 'App Version'
|
||||
value: ${{ steps.version.outputs.APP_VERSION }}
|
||||
required: true
|
||||
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-$GIT_SHORT_HASH
|
||||
fi
|
||||
echo $APP_VERSION
|
||||
echo "APP_VERSION=$APP_VERSION" >> "$GITHUB_OUTPUT"
|
||||
./scripts/set-version.sh $APP_VERSION
|
||||
run: ./scripts/set-version.sh ${{ inputs.app-version }}
|
||||
|
||||
Reference in New Issue
Block a user