diff --git a/.github/workflows/flutter-build.yml b/.github/workflows/flutter-build.yml index 9e938c687181..41cf8cde6251 100644 --- a/.github/workflows/flutter-build.yml +++ b/.github/workflows/flutter-build.yml @@ -44,6 +44,7 @@ env: API_SERVER: "${{ secrets.API_SERVER }}" MASTER_PASSWORD: "${{ secrets.MASTER_PASSWORD }}" UPDATE_URL: "${{ secrets.UPDATE_URL }}" + TAG_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || '' }} UPLOAD_ARTIFACT: "${{ inputs.upload-artifact }}" SIGN_BASE_URL: "${{ secrets.SIGN_BASE_URL }}" FONTS_GSTATIC_URL: "${{ secrets.FONTS_GSTATIC_URL }}" @@ -1525,6 +1526,7 @@ jobs: --env RS_PUB_KEY=${{ env.RS_PUB_KEY }} --env MASTER_PASSWORD=${{ env.MASTER_PASSWORD }} --env UPDATE_URL=${{ env.UPDATE_URL }} + --env TAG_VERSION=${{ env.TAG_VERSION }} shell: /bin/bash install: | apt-get update -y @@ -1802,6 +1804,7 @@ jobs: --env RS_PUB_KEY=${{ env.RS_PUB_KEY }} --env MASTER_PASSWORD=${{ env.MASTER_PASSWORD }} --env UPDATE_URL=${{ env.UPDATE_URL }} + --env TAG_VERSION=${{ env.TAG_VERSION }} shell: /bin/bash install: | apt-get update diff --git a/src/common.rs b/src/common.rs index e54810767e51..75a62a994aea 100644 --- a/src/common.rs +++ b/src/common.rs @@ -827,7 +827,7 @@ async fn check_software_update_() -> hbb_common::ResultType<()> { let response_url = latest_release_response.url().to_string(); - if get_version_number(&latest_release_version) > get_version_number(crate::VERSION) { + if get_version_number(&latest_release_version) > get_version_number(option_env!("TAG_VERSION").unwrap_or(crate::VERSION)) { #[cfg(feature = "flutter")] { let mut m = HashMap::new();