From e1b030aeef81cd593d9341fe78b60c7361521cb7 Mon Sep 17 00:00:00 2001 From: Yixue Wang Date: Mon, 9 Jun 2025 14:08:13 +0800 Subject: [PATCH 1/2] feat: Support VERSION file Use VERSION file to manage DTK version. VERSION file defines package version. It also decides the initial value of cached variable DTK_VERSION which controls the project version in cmake build system. VERSION file is not synchronized to DTK6, as DTK6 has its own VERSION file. One can still pass version to DTK_VERSION when running cmake configure. This is helpful for developers. Signed-off-by: Yixue Wang --- .reuse/dep5 | 2 +- .syncexclude | 1 + CMakeLists.txt | 4 +++- VERSION | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 VERSION diff --git a/.reuse/dep5 b/.reuse/dep5 index ac7495ab..6a42f070 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -49,7 +49,7 @@ Copyright: None License: CC0-1.0 # Project file -Files: *.pro *.prf *.pri *.qrc *CMakeLists.txt *.cmake *.in +Files: *.pro *.prf *.pri *.qrc *CMakeLists.txt *.cmake *.in VERSION Copyright: None License: CC0-1.0 diff --git a/.syncexclude b/.syncexclude index 7b42c60d..f45bbe96 100644 --- a/.syncexclude +++ b/.syncexclude @@ -9,3 +9,4 @@ # are always ignored linglong.yaml conanfile.py +VERSION diff --git a/CMakeLists.txt b/CMakeLists.txt index 23e90eb6..3683d846 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 3.25) -set(DTK_VERSION "5.6.11" CACHE STRING "define project version") +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" DTK_FILE_VERSION) +string(STRIP "${DTK_FILE_VERSION}" DTK_FILE_VERSION) +set(DTK_VERSION "${DTK_FILE_VERSION}" CACHE STRING "define project version") project(DtkGui VERSION ${DTK_VERSION} DESCRIPTION "DTK Gui module" diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..e8406ce3 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +5.7.16 From 3454748ee91a0b4491b2523717dd0f78d630b09b Mon Sep 17 00:00:00 2001 From: Yixue Wang Date: Mon, 9 Jun 2025 14:08:40 +0800 Subject: [PATCH 2/2] feat(ci): Add auto release workflow Log: as title --- .github/workflows/call-auto-release.yml | 50 +++++++++++++++++++++++++ VERSION.in | 1 + 2 files changed, 51 insertions(+) create mode 100644 .github/workflows/call-auto-release.yml create mode 100644 VERSION.in diff --git a/.github/workflows/call-auto-release.yml b/.github/workflows/call-auto-release.yml new file mode 100644 index 00000000..2908c9b9 --- /dev/null +++ b/.github/workflows/call-auto-release.yml @@ -0,0 +1,50 @@ +name: Auto Release +on: + workflow_dispatch: + inputs: + version: + description: 'Release version (e.g., 1.0.0)' + type: string + required: true + name: + description: 'The name of the person to release the version' + type: string + required: false + email: + description: 'The email of the person to release the version' + type: string + required: false + timezone: + description: 'The timezone in the debian changelog file' + required: false + type: string + default: 'Asia/Shanghai' + workflow_call: + inputs: + version: + description: 'Release version (e.g., 1.0.0)' + type: string + required: true + name: + description: 'The name of the person to release the version' + type: string + required: false + email: + description: 'The email of the person to release the version' + type: string + required: false + timezone: + description: 'The timezone in the debian changelog file' + required: false + type: string + default: 'Asia/Shanghai' + +jobs: + auto_release: + uses: linuxdeepin/.github/.github/workflows/auto-release.yml@master + secrets: inherit + with: + version: ${{ inputs.version }} + name: ${{ inputs.name }} + email: ${{ inputs.email }} + timezone: ${{ inputs.timezone }} diff --git a/VERSION.in b/VERSION.in new file mode 100644 index 00000000..14d2ff63 --- /dev/null +++ b/VERSION.in @@ -0,0 +1 @@ +@version@