Skip to content

Commit acd9930

Browse files
authored
feat: Support VERSION file (#102)
* 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. Signed-off-by: Yixue Wang <wangyixue@deepin.org> * feat(ci): Add auto release workflow Signed-off-by: Yixue Wang <wangyixue@deepin.org> --------- Signed-off-by: Yixue Wang <wangyixue@deepin.org>
1 parent 0a35dce commit acd9930

5 files changed

Lines changed: 56 additions & 2 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Auto Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: 'Release version (e.g., 1.0.0)'
7+
type: string
8+
required: true
9+
name:
10+
description: 'The name of the person to release the version'
11+
type: string
12+
required: false
13+
email:
14+
description: 'The email of the person to release the version'
15+
type: string
16+
required: false
17+
timezone:
18+
description: 'The timezone in the debian changelog file'
19+
required: false
20+
type: string
21+
default: 'Asia/Shanghai'
22+
workflow_call:
23+
inputs:
24+
version:
25+
description: 'Release version (e.g., 1.0.0)'
26+
type: string
27+
required: true
28+
name:
29+
description: 'The name of the person to release the version'
30+
type: string
31+
required: false
32+
email:
33+
description: 'The email of the person to release the version'
34+
type: string
35+
required: false
36+
timezone:
37+
description: 'The timezone in the debian changelog file'
38+
required: false
39+
type: string
40+
default: 'Asia/Shanghai'
41+
42+
jobs:
43+
auto_release:
44+
uses: linuxdeepin/.github/.github/workflows/auto-release.yml@master
45+
secrets: inherit
46+
with:
47+
version: ${{ inputs.version }}
48+
name: ${{ inputs.name }}
49+
email: ${{ inputs.email }}
50+
timezone: ${{ inputs.timezone }}

.reuse/dep5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ Copyright: None
3939
License: CC0-1.0
4040

4141
# cmake
42-
Files: *.cmake *CMakeLists.txt *.pc.in
42+
Files: *.cmake *CMakeLists.txt *.pc.in VERSION VERSION.in
4343
Copyright: None
4444
License: CC0-1.0

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
# SPDX-License-Identifier: BSD-3-Clause
44

55
cmake_minimum_required(VERSION 3.13)
6-
set (DTK_VERSION "5.6.12" CACHE STRING "define project version")
6+
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" DTK_FILE_VERSION)
7+
string(STRIP "${DTK_FILE_VERSION}" DTK_FILE_VERSION)
8+
set(DTK_VERSION "${DTK_FILE_VERSION}" CACHE STRING "define project version")
79
project(dtkcommon
810
VERSION ${DTK_VERSION}
911
DESCRIPTION "DTK common"

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.7.16

VERSION.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@version@

0 commit comments

Comments
 (0)