mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
<!-- 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 -->
43 lines
1.5 KiB
YAML
43 lines
1.5 KiB
YAML
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"
|