From 4afbbd3fff2ae18f7bd200cc089d30911cbbd7d6 Mon Sep 17 00:00:00 2001 From: Yixue Wang Date: Mon, 9 Jun 2025 17:38:08 +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 | 4 ++-- .syncexclude | 2 ++ CMakeLists.txt | 4 +++- VERSION | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .syncexclude create mode 100644 VERSION diff --git a/.reuse/dep5 b/.reuse/dep5 index 9392f20fc..7c7ff1c9c 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -34,7 +34,7 @@ Copyright: UnionTech Software Technology Co., Ltd. License: CC-BY-4.0 # ci -Files: .github/* *.yml *.yaml .obs/* +Files: .github/* *.yml *.yaml .obs/* .syncexclude Copyright: None License: CC0-1.0 @@ -54,7 +54,7 @@ Copyright: None License: CC0-1.0 # cmake -Files: *.cmake *CMakeLists.txt *.in +Files: *.cmake *CMakeLists.txt *.in VERSION Copyright: None License: CC0-1.0 diff --git a/.syncexclude b/.syncexclude new file mode 100644 index 000000000..a6ab4e8ad --- /dev/null +++ b/.syncexclude @@ -0,0 +1,2 @@ +linglong.yaml +VERSION diff --git a/CMakeLists.txt b/CMakeLists.txt index 78782cd29..70c2b7d0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ cmake_minimum_required(VERSION 3.10) -set(DTK_VERSION "5.6.23" 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(DtkDeclarative VERSION "${DTK_VERSION}" DESCRIPTION "DTK Declarative module" diff --git a/VERSION b/VERSION new file mode 100644 index 000000000..e8406ce30 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +5.7.16 From 9484299700fdfc81a1dcf76ef485a523a0b43aae Mon Sep 17 00:00:00 2001 From: Yixue Wang Date: Mon, 9 Jun 2025 17:38:43 +0800 Subject: [PATCH 2/2] feat(ci): Add auto release workflow Log: as title Signed-off-by: Yixue Wang --- .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 000000000..2908c9b97 --- /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 000000000..14d2ff637 --- /dev/null +++ b/VERSION.in @@ -0,0 +1 @@ +@version@