Merge branch 'develop' into develop_liyi
This commit is contained in:
commit
a588c126bf
@ -21,6 +21,15 @@ variables:
|
|||||||
- if: $CI_COMMIT_BRANCH == "canary_release"
|
- if: $CI_COMMIT_BRANCH == "canary_release"
|
||||||
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$/
|
- if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$/
|
||||||
|
|
||||||
|
.notify_rule:
|
||||||
|
tags:
|
||||||
|
- macos
|
||||||
|
- flutter
|
||||||
|
rules:
|
||||||
|
- if: $CI_COMMIT_BRANCH == "develop"
|
||||||
|
- if: $CI_COMMIT_BRANCH == "release"
|
||||||
|
- if: $CI_COMMIT_BRANCH =~ /feat_[a-zA-Z]+/
|
||||||
|
|
||||||
.generate_tag_rule:
|
.generate_tag_rule:
|
||||||
tags:
|
tags:
|
||||||
- macos
|
- macos
|
||||||
@ -173,3 +182,23 @@ create-release:
|
|||||||
- name: 'sky ipa binary package'
|
- name: 'sky ipa binary package'
|
||||||
url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${CI_COMMIT_TAG}/starlock-sky-release-${CI_COMMIT_TAG}.ipa'
|
url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/StarLock/${CI_COMMIT_TAG}/starlock-sky-release-${CI_COMMIT_TAG}.ipa'
|
||||||
link_type: 'package'
|
link_type: 'package'
|
||||||
|
|
||||||
|
notify_success:
|
||||||
|
stage: notification
|
||||||
|
extends: .notify_rule
|
||||||
|
before_script:
|
||||||
|
- printenv | while IFS='=' read -r key value; do echo "$key=$value"; done
|
||||||
|
script:
|
||||||
|
- bash notify.sh success
|
||||||
|
allow_failure: true
|
||||||
|
when: on_success
|
||||||
|
|
||||||
|
notify_failure:
|
||||||
|
stage: notification
|
||||||
|
extends: .notify_rule
|
||||||
|
before_script:
|
||||||
|
- printenv | while IFS='=' read -r key value; do echo "$key=$value"; done
|
||||||
|
script:
|
||||||
|
- bash notify.sh failure
|
||||||
|
allow_failure: true
|
||||||
|
when: on_failure
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1500"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Release-dev"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<Testables>
|
||||||
|
</Testables>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug-pre-sky"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release-dev"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Release-dev">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release-dev"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
||||||
@ -0,0 +1,71 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1500"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Release-dev"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<Testables>
|
||||||
|
</Testables>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug-pre-xhj"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Release-dev"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Release-dev">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release-dev"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
||||||
36
notify.sh
Executable file
36
notify.sh
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
APP_PRODUCT_NAME=$APP_PRODUCT_NAME
|
||||||
|
BUILD_STATUS=$1
|
||||||
|
if [[ "${CI_COMMIT_BRANCH}" == "release" ]] ; then
|
||||||
|
WECAHT_WEBHOOK_URL=$PRE_QYWECAHT_WEBHOOK_URL
|
||||||
|
SKY_IOS_DOWNLOAD_URL=$PRE_SKY_IOS_DOWNLOAD_URL
|
||||||
|
SKY_ANDROID_DOWNLOAD_URL=$PRE_SKY_ANDROID_DOWNLOAD_URL
|
||||||
|
XHJ_IOS_DOWNLOAD_URL=$PRE_XHJ_IOS_DOWNLOAD_URL
|
||||||
|
XHJ_ANDROID_DOWNLOAD_URL=$PRE_XHJ_ANDROID_DOWNLOAD_URL
|
||||||
|
elif [[ "${CI_COMMIT_BRANCH}" == "develop" ]] || [[ "${CI_COMMIT_BRANCH}" == "feat_devops" ]]; then
|
||||||
|
WECAHT_WEBHOOK_URL=$DEV_QYWECAHT_WEBHOOK_URL
|
||||||
|
SKY_IOS_DOWNLOAD_URL=$DEV_SKY_IOS_DOWNLOAD_URL
|
||||||
|
SKY_ANDROID_DOWNLOAD_URL=$DEV_SKY_ANDROID_DOWNLOAD_URL
|
||||||
|
XHJ_IOS_DOWNLOAD_URL=$DEV_XHJ_IOS_DOWNLOAD_URL
|
||||||
|
XHJ_ANDROID_DOWNLOAD_URL=$DEV_XHJ_ANDROID_DOWNLOAD_URL
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${BUILD_STATUS}" == "success" ]]; then
|
||||||
|
TITLE="😎 构建成功"
|
||||||
|
BUILD_STATUS_DESC="成功"
|
||||||
|
NOTIFICATION_CONENT='{"msgtype":"markdown","markdown":{"content":"'$TITLE'\n> **项目名称**: '$APP_PRODUCT_NAME'\n> **分支**: '$CI_COMMIT_REF_NAME'\n> **构建状态**: '$BUILD_STATUS_DESC'\n> **安装地址**:\n 通通公寓 ** [iOS]('$SKY_IOS_DOWNLOAD_URL') ** ** [Android]('$SKY_ANDROID_DOWNLOAD_URL')**\n > ** 星星公寓 ** [iOS]('$XHJ_IOS_DOWNLOAD_URL') ** ** [Android]('$XHJ_ANDROID_DOWNLOAD_URL')** \n> **详情查看**: [构建日志]('$CI_JOB_URL')"}}'
|
||||||
|
else
|
||||||
|
TITLE="😥 部署失败"
|
||||||
|
BUILD_STATUS_DESC="失败"
|
||||||
|
NOTIFICATION_CONENT='{"msgtype":"markdown","markdown":{"content": "'$TITLE'\n> **项目名称**: '$APP_PRODUCT_NAME'\n> **分支**: '$CI_COMMIT_REF_NAME'\n> **构建状态**: '$BUILD_STATUS_DESC'\n>**详情查看**: [构建日志]('$CI_JOB_URL')"}}'
|
||||||
|
fi
|
||||||
|
echo "$NOTIFICATION_CONENT"
|
||||||
|
JSON_PAYLOAD=$(cat <<EOF
|
||||||
|
$NOTIFICATION_CONENT
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
echo "$WECAHT_WEBHOOK_URL"
|
||||||
|
echo "CI_JOB_STATUS:${CI_JOB_STATUS},APP_PRODUCT_NAME:${APP_PRODUCT_NAME},TITLE:${TITLE},BUILD_STATUS_DESC:${BUILD_STATUS_DESC},WECAHT_WEBHOOK_URL:${WECAHT_WEBHOOK_URL},CI_JOB_URL:${CI_JOB_URL}"
|
||||||
|
curl $WECAHT_WEBHOOK_URL -X POST -H "Content-Type: application/json" -d "$JSON_PAYLOAD"
|
||||||
|
exit 0
|
||||||
Loading…
x
Reference in New Issue
Block a user