diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 69738d60..64896dab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -18,7 +18,6 @@ variables: rules: - if: $CI_COMMIT_BRANCH == "develop" - if: $CI_COMMIT_BRANCH == "release" - - if: $CI_COMMIT_BRANCH == "release_sky" - if: $CI_COMMIT_BRANCH =~ /feat_[a-zA-Z]+/ - if: $CI_COMMIT_BRANCH == "canary_release" - if: $CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$/ @@ -30,7 +29,6 @@ variables: rules: - if: $CI_COMMIT_BRANCH == "develop" - if: $CI_COMMIT_BRANCH == "release" - - if: $CI_COMMIT_BRANCH == "release_sky" - if: $CI_COMMIT_BRANCH =~ /feat_[a-zA-Z]+/ .generate_tag_rule: @@ -39,7 +37,6 @@ variables: - flutter rules: - if: $CI_COMMIT_BRANCH == "master" - - if: $CI_COMMIT_BRANCH == "master_sky" .generate_next_version_rule: tags: @@ -48,7 +45,6 @@ variables: rules: - if: $CI_COMMIT_BRANCH == "develop" - if: $CI_COMMIT_BRANCH == "release" - - if: $CI_COMMIT_BRANCH == "release_sky" - if: $CI_COMMIT_BRANCH == "canary_release" - if: $CI_COMMIT_BRANCH =~ /feat_[a-zA-Z]+/ @@ -64,31 +60,10 @@ variables: .setup_fastlane_android: extends: .build_rule before_script: - - rm -rf ~/.gem ~/.bundle vendor/bundle_android # 强烈建议每次清理,防止并发/缓存污染 - - export PATH="$HOME/.rbenv/bin:$PATH" - - eval "$(rbenv init -)" - - rbenv global 2.7.8 - - export PATH="$HOME/.rbenv/shims:$PATH" - - which ruby # 输出当前使用的ruby路径,便于调试 - - ruby -v # 输出当前ruby版本,便于调试 - - gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ # 如在国外可移除此行 - - bundle config mirror.https://rubygems.org https://mirrors.aliyun.com/rubygems/ - - bundle -v || gem install bundler --source https://gems.ruby-china.com/ - ls -li - export NEXT_VERSION="$(cat app_new.version)" - - bundle config set --local path 'vendor/bundle_android' # Android独立依赖目录 - - bundle install --gemfile android/Gemfile # 去掉--quiet,便于观察进度 - - gem pristine --all || true # 修复所有未编译的gem扩展 - script: - # 输出调试信息,便于后续排查环境问题 - - echo "=== DEBUG INFO (android) ===" - - which ruby - - ruby -v - - which gem - - gem -v - - echo $PATH - - env - - bash android/build.sh + # - flutter pub get + - bundle install --gemfile android/Gemfile --quiet cache: paths: - app_new.version @@ -96,31 +71,10 @@ variables: .setup_fastlane_ios: extends: .build_rule before_script: - - rm -rf ~/.gem ~/.bundle vendor/bundle_ios # 强烈建议每次清理,防止并发/缓存污染 - - export PATH="$HOME/.rbenv/bin:$PATH" - - eval "$(rbenv init -)" - - rbenv global 2.7.8 - - export PATH="$HOME/.rbenv/shims:$PATH" - - which ruby # 输出当前使用的ruby路径,便于调试 - - ruby -v # 输出当前ruby版本,便于调试 - - gem sources --add https://gems.ruby-china.com/ --remove https://rubygems.org/ # 如在国外可移除此行 - - bundle config mirror.https://rubygems.org https://gems.ruby-china.com - - bundle -v || gem install bundler --source https://gems.ruby-china.com/ - ls -li - export NEXT_VERSION="$(cat app_new.version)" - - bundle config set --local path 'vendor/bundle_ios' # iOS独立依赖目录 - - bundle install --gemfile ios/Gemfile # 去掉--quiet,便于观察进度 - - gem pristine --all || true # 修复所有未编译的gem扩展 - script: - # 输出调试信息,便于后续排查环境问题 - - echo "=== DEBUG INFO (ios) ===" - - which ruby - - ruby -v - - which gem - - gem -v - - echo $PATH - - env - - bash ios/build.sh + # - flutter pub get + - bundle install --gemfile ios/Gemfile --quiet cache: paths: - app_new.version @@ -159,15 +113,7 @@ generate_next_version: build_android: stage: build-artifacts extends: .setup_fastlane_android - script: - - echo "=== DEBUG INFO (android) ===" - - which ruby - - ruby -v - - which gem - - gem -v - - echo $PATH - - env - - bash android/build.sh + script: bash android/build.sh artifacts: paths: - build/app/outputs/flutter-apk/ @@ -176,13 +122,6 @@ build_ios: stage: build-artifacts extends: .setup_fastlane_ios script: - - echo "=== DEBUG INFO (ios) ===" - - which ruby - - ruby -v - - which gem - - gem -v - - echo $PATH - - env - bash ios/build.sh artifacts: paths: diff --git a/android/Gemfile b/android/Gemfile index 79087196..cdd3a6b3 100644 --- a/android/Gemfile +++ b/android/Gemfile @@ -1,7 +1,6 @@ -source "https://mirrors.aliyun.com/rubygems/" +source "https://rubygems.org" gem "fastlane" -gem 'nkf', '0.2.0' plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') eval_gemfile(plugins_path) if File.exist?(plugins_path) diff --git a/android/build.sh b/android/build.sh index f444cb1e..10618af0 100755 --- a/android/build.sh +++ b/android/build.sh @@ -8,29 +8,41 @@ export ENV_BUILD_WORKSPACE=${CI_PROJECT_DIR} echo "GITLAB_WORKSPACE: ${CI_PROJECT_DIR}" cd ${CI_PROJECT_DIR}/android echo "ENV_BUILD_TAG:${ENV_BUILD_TAG},ENV_BUILD_BRANCH:${ENV_BUILD_BRANCH}" -regex='^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$' +regex='^(sky_)?v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$' if [[ "${ENV_BUILD_BRANCH}" == "canary_release" ]]; then echo "===build canary_release: ${NEXT_VERSION}" export ENV_BUILD_TAG=${NEXT_VERSION} - bundle exec fastlane release_apk flavor:xhj --verbose - bundle exec fastlane release_apk flavor:sky --verbose + bundle exec fastlane release_apk flavor:xhj --verbose || { echo "[FATAL] fastlane release_apk xhj 失败"; exit 10; } + bundle exec fastlane release_apk flavor:sky --verbose || { echo "[FATAL] fastlane release_apk sky 失败"; exit 11; } elif [[ $ENV_BUILD_TAG =~ $regex ]]; then echo "===build release===$ENV_BUILD_TAG" - bundle exec fastlane release_apk flavor:xhj --verbose - bundle exec fastlane release_apk flavor:sky --verbose - bundle exec fastlane release_bundle flavor:xhj_bundle --verbose - bundle exec fastlane release_bundle flavor:sky --verbose + bundle exec fastlane release_apk flavor:xhj --verbose || { echo "[FATAL] fastlane release_apk xhj 失败"; exit 10; } + bundle exec fastlane release_apk flavor:sky --verbose || { echo "[FATAL] fastlane release_apk sky 失败"; exit 11; } + bundle exec fastlane release_bundle flavor:xhj_bundle --verbose || { echo "[FATAL] fastlane release_bundle xhj_bundle 失败"; exit 12; } + bundle exec fastlane release_bundle flavor:sky --verbose || { echo "[FATAL] fastlane release_bundle sky 失败"; exit 13; } + echo "=== fastlane lane 结束,检查产物目录(前) ===" + ls -lh build/app/outputs/flutter-apk/ || true + ls -lh build/app/outputs/bundle/ || true + if [ ! -d build/app/outputs/flutter-apk/ ]; then + echo "❌ 产物目录 build/app/outputs/flutter-apk/ 未生成,构建失败!" + echo "=== 产物目录消失时,build/app/outputs/ 内容如下 ===" + ls -lh build/app/outputs/ || true + ls -lh build/app/outputs/bundle/ || true + exit 99 + fi + echo "=== 产物目录检查通过,最终内容如下 ===" + ls -l build/app/outputs/flutter-apk/ elif [[ "${ENV_BUILD_BRANCH}" == "develop" ]]; then echo "===build dev===${NEXT_VERSION}" - bundle exec fastlane beta flavor:xhj env:dev --verbose - bundle exec fastlane beta flavor:sky env:dev --verbose + bundle exec fastlane beta flavor:xhj env:dev --verbose || { echo "[FATAL] fastlane beta xhj dev 失败"; exit 20; } + bundle exec fastlane beta flavor:sky env:dev --verbose || { echo "[FATAL] fastlane beta sky dev 失败"; exit 21; } elif [[ "${ENV_BUILD_BRANCH}" == "release" ]] || [[ "${ENV_BUILD_BRANCH}" == "feat_devops" ]] ; then echo "===build pre===${NEXT_VERSION}" - bundle exec fastlane beta flavor:xhj env:pre --verbose - bundle exec fastlane beta flavor:sky env:pre --verbose + bundle exec fastlane beta flavor:xhj env:pre --verbose || { echo "[FATAL] fastlane beta xhj pre 失败"; exit 30; } + bundle exec fastlane beta flavor:sky env:pre --verbose || { echo "[FATAL] fastlane beta sky pre 失败"; exit 31; } elif [[ "${ENV_BUILD_BRANCH}" == "release_sky" ]]; then echo "===build release_sky===${NEXT_VERSION}" - bundle exec fastlane release_apk flavor:sky --verbose - bundle exec fastlane release_bundle flavor:sky --verbose + bundle exec fastlane release_apk flavor:sky --verbose || { echo "[FATAL] fastlane release_apk sky 失败"; exit 40; } + bundle exec fastlane release_bundle flavor:sky --verbose || { echo "[FATAL] fastlane release_bundle sky 失败"; exit 41; } fi exit 0 \ No newline at end of file diff --git a/android/fastlane/Fastfile b/android/fastlane/Fastfile index 2c66fff4..a99f62f0 100644 --- a/android/fastlane/Fastfile +++ b/android/fastlane/Fastfile @@ -90,7 +90,7 @@ platform :android do print_log "build flavor for: #{flavor}" build_number = Time.now.strftime("%Y%m%d%H") print_log "BuildNo #{build_number}" - build_version = $current_tag.match(/^(sky_)?v(\d+\.\d+\.\d+)/).captures.last + build_version = $current_tag.match(/^v(\d+\.\d+\.\d+)/).captures[0] print_log "buildVersion #{build_version}" commit_hash = last_git_commit short_hash = commit_hash[:abbreviated_commit_hash] @@ -112,7 +112,7 @@ platform :android do print_log "build flavor for: #{flavor}" build_number = Time.now.strftime("%Y%m%d%H") print_log "BuildNo #{build_number}" - build_version = $current_tag.match(/^(sky_)?v(\d+\.\d+\.\d+)/).captures.last + build_version = $current_tag.match(/^v(\d+\.\d+\.\d+)/).captures[0] print_log "buildVersion #{build_version}" commit_hash = last_git_commit short_hash = commit_hash[:abbreviated_commit_hash] diff --git a/ios/Gemfile b/ios/Gemfile index 8a7082c8..21cb5dfc 100644 --- a/ios/Gemfile +++ b/ios/Gemfile @@ -1,8 +1,7 @@ -source "https://gems.ruby-china.com" +source "https://rubygems.org" gem "fastlane" gem 'cocoapods', '1.14.3' gem 'public_suffix', '~> 4.0' plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile') eval_gemfile(plugins_path) if File.exist?(plugins_path) -gem 'nkf', '0.2.0' diff --git a/ios/build.sh b/ios/build.sh index b492d623..e7235771 100755 --- a/ios/build.sh +++ b/ios/build.sh @@ -9,7 +9,7 @@ echo "GITLAB_WORKSPACE: ${CI_PROJECT_DIR}" cd ${CI_PROJECT_DIR}/ios #bundle exec pod install echo "ENV_BUILD_TAG:${ENV_BUILD_TAG},ENV_BUILD_BRANCH:${ENV_BUILD_BRANCH}" -regex='^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$' +regex='^(sky_)?v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z]+\.[0-9]+)?$' # ==== 调试输出,确认环境和依赖 ==== echo "=== FASTLANE/GEM/ENV DEBUG ===" @@ -25,19 +25,21 @@ gem list | grep digest-crc if [[ "${ENV_BUILD_BRANCH}" == "canary_release" ]]; then echo "===build canary_release: ${NEXT_VERSION}" export ENV_BUILD_TAG=${NEXT_VERSION} - bundle exec fastlane release_ipa flavor:xhj --verbose - bundle exec fastlane release_ipa flavor:sky --verbose + bundle exec fastlane release_ipa flavor:xhj --verbose || { echo "[FATAL] fastlane release_ipa xhj 失败"; exit 10; } + bundle exec fastlane release_ipa flavor:sky --verbose || { echo "[FATAL] fastlane release_ipa sky 失败"; exit 11; } elif [[ $ENV_BUILD_TAG =~ $regex ]]; then echo "===build release===$ENV_BUILD_TAG" - bundle exec fastlane release_ipa flavor:xhj --verbose - bundle exec fastlane release_ipa flavor:sky --verbose + # 无论tag前缀,均构建xhj和sky的ipa + bundle exec fastlane release_ipa flavor:xhj --verbose || { echo "[FATAL] fastlane release_ipa xhj 失败"; exit 10; } + bundle exec fastlane release_ipa flavor:sky --verbose || { echo "[FATAL] fastlane release_ipa sky 失败"; exit 11; } + ls -l build/app/outputs/flutter-ipa/ elif [[ "${ENV_BUILD_BRANCH}" == "develop" ]]; then echo "===build dev===${NEXT_VERSION}" - bundle exec fastlane beta flavor:xhj env:Dev --verbose - bundle exec fastlane beta flavor:sky env:Dev --verbose + bundle exec fastlane beta flavor:xhj env:Dev --verbose || { echo "[FATAL] fastlane beta xhj Dev 失败"; exit 20; } + bundle exec fastlane beta flavor:sky env:Dev --verbose || { echo "[FATAL] fastlane beta sky Dev 失败"; exit 21; } elif [[ "${ENV_BUILD_BRANCH}" == "release" ]] || [[ "${ENV_BUILD_BRANCH}" == "feat_devops" ]] ; then echo "===build pre===${NEXT_VERSION}" - bundle exec fastlane beta flavor:xhj env:Pre --verbose - bundle exec fastlane beta flavor:sky env:Pre --verbose + bundle exec fastlane beta flavor:xhj env:Pre --verbose || { echo "[FATAL] fastlane beta xhj Pre 失败"; exit 30; } + bundle exec fastlane beta flavor:sky env:Pre --verbose || { echo "[FATAL] fastlane beta sky Pre 失败"; exit 31; } fi exit 0 \ No newline at end of file diff --git a/lib/main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart b/lib/main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart index 58c5a9bb..20c36487 100755 --- a/lib/main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart +++ b/lib/main/lockDetail/lockSet/basicInformation/basicInformation/basicInformation_page.dart @@ -158,23 +158,23 @@ class _BasicInformationPageState extends State { allHeight: 70.h, isHaveLine: true), )), - Obx(() => CommonItem( - leftTitel: '位置信息'.tr, - // rightTitle: state.lockBasicInfo.value.address ?? "-", - allHeight: 80.h, - isHaveLine: false, - isHaveRightWidget: true, - rightWidget: SizedBox( - width: 300.w, - child: Text(state.lockBasicInfo.value.address ?? '无'.tr, - maxLines: 2, - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.end, - style: TextStyle( - fontSize: 22.sp, - color: AppColors.darkGrayTextColor)), - ), - )), + // Obx(() => CommonItem( + // leftTitel: '位置信息'.tr, + // // rightTitle: state.lockBasicInfo.value.address ?? "-", + // allHeight: 80.h, + // isHaveLine: false, + // isHaveRightWidget: true, + // rightWidget: SizedBox( + // width: 300.w, + // child: Text(state.lockBasicInfo.value.address ?? '无'.tr, + // maxLines: 2, + // overflow: TextOverflow.ellipsis, + // textAlign: TextAlign.end, + // style: TextStyle( + // fontSize: 22.sp, + // color: AppColors.darkGrayTextColor)), + // ), + // )), /* 2024-01-12 会议确定去掉“微信二维码” by DaisyWu CommonItem( leftTitel: diff --git a/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart b/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart index 5b72e229..195c2ab6 100644 --- a/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart +++ b/lib/talk/starChart/handle/impl/udp_talk_request_handler.dart @@ -237,15 +237,18 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle if (isH264) { // 锁支持H264,发送H264视频和G711音频期望 startChartManage.sendOnlyH264VideoTalkExpectData(); - print('app收到的对讲请求后,发送的预期数据=========锁支持H264,发送H264视频格式期望数据'); + print( + 'app收到的对讲请求后,发送的预期数据=========锁支持H264,发送H264视频格式期望数据,peerID=${lockPeerID}'); } else if (isMJpeg) { // 锁只支持MJPEG,发送图像视频和G711音频期望 startChartManage.sendOnlyImageVideoTalkExpectData(); - print('app收到的对讲请求后,发送的预期数据=========锁不支持H264,支持MJPEG,发送MJPEG视频格式期望数据'); + print( + 'app收到的对讲请求后,发送的预期数据=========锁不支持H264,支持MJPEG,发送MJPEG视频格式期望数据,peerID=${lockPeerID}'); } else { // 默认使用图像视频 startChartManage.sendOnlyImageVideoTalkExpectData(); - print('app收到的对讲请求后,发送的预期数据=========锁不支持H264和MJPEG,默认发送图像视频格式期望数据'); + print( + 'app收到的对讲请求后,发送的预期数据=========锁不支持H264和MJPEG,默认发送MJPEG视频格式期望数据,peerID=${lockPeerID}'); } } @@ -281,15 +284,18 @@ class UdpTalkRequestHandler extends ScpMessageBaseHandle if (isH264) { // 锁支持H264,发送H264视频和G711音频期望 startChartManage.sendH264VideoAndG711AudioTalkExpectData(); - print('app主动发请求,收到回复后发送的预期数据=======锁支持H264,发送H264视频格式期望数据'); + AppLog.log( + 'app主动发对讲请求,收到回复后发送的预期数据=======锁支持H264,发送H264视频格式期望数据,peerID=${lockPeerID}'); } else if (isMJpeg) { // 锁只支持MJPEG,发送图像视频和G711音频期望 startChartManage.sendImageVideoAndG711AudioTalkExpectData(); - print('app主动发请求,收到回复后发送的预期数据=======锁不支持H264,支持MJPEG,发送MJPEG视频格式期望数据'); + AppLog.log( + 'app主动发对讲请求,收到回复后发送的预期数据=======锁不支持H264,支持MJPEG,发送MJPEG视频格式期望数据,peerID=${lockPeerID}'); } else { // 默认使用图像视频 startChartManage.sendImageVideoAndG711AudioTalkExpectData(); - print('app主动发请求,收到回复后发送的预期数据=======锁不支持H264和MJPEG,默认发送图像视频格式期望数据'); + AppLog.log( + 'app主动发对讲请求,收到回复后发送的预期数据=======锁不支持H264和MJPEG,默认发送MJPEG视频格式期望数据,peerID=${lockPeerID}'); } } } diff --git a/lib/talk/starChart/views/imageTransmission/image_transmission_page.dart b/lib/talk/starChart/views/imageTransmission/image_transmission_page.dart index 3340151c..60b023bd 100644 --- a/lib/talk/starChart/views/imageTransmission/image_transmission_page.dart +++ b/lib/talk/starChart/views/imageTransmission/image_transmission_page.dart @@ -61,7 +61,7 @@ class _ImageTransmissionPageState extends State barTitle: '图传'.tr, haveBack: true, backgroundColor: AppColors.mainColor, - backAction: (){ + backAction: () { logic.udpHangUpAction(); }, ), @@ -183,10 +183,7 @@ class _ImageTransmissionPageState extends State icon: Icons.camera_alt, color: Colors.blue, onTap: () async { - if (state.talkStatus.value == - TalkStatus.answeredSuccessfully) { - await logic.captureAndSavePng(); - } + await logic.captureAndSavePng(); }, ), ], @@ -200,7 +197,10 @@ class _ImageTransmissionPageState extends State outerColor: Colors.amber.withOpacity(0.15), sliderButtonIcon: Icon(Icons.lock, color: Colors.white, size: 40.w), text: '滑动解锁', - textStyle: TextStyle(fontSize: 26.sp, color: Colors.black54, fontWeight: FontWeight.bold), + textStyle: TextStyle( + fontSize: 26.sp, + color: Colors.black54, + fontWeight: FontWeight.bold), onSubmit: () { // TODO: 实现滑动解锁逻辑 logic.remoteOpenLock(); diff --git a/lib/talk/starChart/views/native/talk_view_native_decode_logic.dart b/lib/talk/starChart/views/native/talk_view_native_decode_logic.dart index 606ae73c..9ddf4a57 100644 --- a/lib/talk/starChart/views/native/talk_view_native_decode_logic.dart +++ b/lib/talk/starChart/views/native/talk_view_native_decode_logic.dart @@ -576,17 +576,25 @@ class TalkViewNativeDecodeLogic extends BaseGetXController { /// 更新发送预期数据 void updateTalkExpect() { + // 清晰度与VideoTypeE的映射 + final Map qualityToVideoType = { + '标清': VideoTypeE.H264, + '高清': VideoTypeE.H264_720P, + // 可扩展更多清晰度 + }; TalkExpectReq talkExpectReq = TalkExpectReq(); state.isOpenVoice.value = !state.isOpenVoice.value; + // 根据当前清晰度动态设置videoType + VideoTypeE currentVideoType = qualityToVideoType[state.currentQuality.value] ?? VideoTypeE.H264; if (!state.isOpenVoice.value) { talkExpectReq = TalkExpectReq( - videoType: [VideoTypeE.H264], + videoType: [currentVideoType], audioType: [], ); showToast('已静音'.tr); } else { talkExpectReq = TalkExpectReq( - videoType: [VideoTypeE.H264], + videoType: [currentVideoType], audioType: [AudioTypeE.G711], ); } diff --git a/tag_generator.sh b/tag_generator.sh index 35529ba2..27e39182 100755 --- a/tag_generator.sh +++ b/tag_generator.sh @@ -15,17 +15,15 @@ if [ "$tags_length" -lt 1 ]; then next_tag="v1.0.0" else newest_tag=$(echo "$tags" | head -n 1) - # 去除已有的sky_前缀,防止重复 - base_tag=${newest_tag#sky_} - IFS='.' read -r major minor patch <<< "$base_tag" + IFS='.' read -r major minor patch <<< "$newest_tag" major="${major#v}" compare_json="" if [[ "$1" == "generate_tag" ]];then - echo "generate_tag:$newest_tag-to-master_sky\n" - compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=$newest_tag&to=master_sky") + echo "generate_tag:$newest_tag-to-master\n" + compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=$newest_tag&to=master") elif [[ "$1" == "generate_version" ]]; then - echo "generate_version:master_sky-to-$CI_COMMIT_BRANCH\n" - compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=master_sky&to=$CI_COMMIT_BRANCH") + echo "generate_version:master-to-$CI_COMMIT_BRANCH\n" + compare_json=$(curl -s --header "PRIVATE-TOKEN: $TOKEN" "$URL/projects/$PROJECT_ID/repository/compare?from=master&to=$CI_COMMIT_BRANCH") fi echo "compare_json:$compare_json\n" new_patch=$patch @@ -47,13 +45,6 @@ else done < <(echo "$compare_json" | jq -c '.commits[] | {id: .id, message: .message}') next_tag="v$major.$new_minor.$new_patch" fi - -# 生成新tag名时,若在master_sky分支,加前缀sky_ -branch_name="$CI_COMMIT_BRANCH" -if [[ "$branch_name" == "master_sky" ]]; then - next_tag="sky_${next_tag}" -fi - echo "New Tag:$newest_tag;New version: $next_tag;command: $1" if [[ "$1" == "generate_tag" ]];then if [ "$next_tag" == "$newest_tag" ]; then