Skip to content

Commit 5ad5912

Browse files
committed
[CI] enhancement: fix release tags
Signed-off-by: Shreyas Atre <shreyasatre16@gmail.com>
1 parent 3f37f8f commit 5ad5912

3 files changed

Lines changed: 15 additions & 13 deletions

File tree

.github/workflows/armhf-build.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ name: armhf build
22

33
on:
44
push:
5-
branches:
6-
- main
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
78

89
env:
910
BUILD_TYPE: Release
@@ -26,13 +27,15 @@ jobs:
2627
cd build
2728
cmake .. -DCMAKE_CXX_COMPILER=$(which arm-linux-gnueabihf-g++-8) \
2829
-DCMAKE_C_COMPILER=$(which arm-linux-gnueabihf-gcc-8) \
29-
-DARMHF_DEB=ON
30+
-DARMHF_DEB=ON \
31+
-DARCHITECTURE="armhf" \
32+
-DGIT_VERSION=${{ github.ref }}
3033
make -j$(nproc)
3134
make package
3235
armhf__filename__=$(echo $(ls ${{steps.armhf-artifact-download.outputs.download-path}} | grep ..armhf.deb) | tr -d '\n')
3336
version__name__=${armhf__filename__#*-}
3437
name__=$(echo ${armhf__filename__%-*} | tr -d '\n')
35-
version__=$(cat ../VERSION)
38+
version__=${{ github.ref }}
3639
echo "name__=$name__" >> $GITHUB_ENV
3740
echo "version__=$version__" >> $GITHUB_ENV
3841
echo "armhf__filename__=$armhf__filename__" >> $GITHUB_ENV
@@ -42,8 +45,8 @@ jobs:
4245
env:
4346
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4447
with:
45-
tag_name: ${{ env.version__ }}
46-
release_name: ${{ env.name__ }}
48+
tag_name: ${{ github.ref }}
49+
release_name: Release ${{ github.ref }}
4750
draft: false
4851
prerelease: false
4952
- name: Upload Release Asset

CMakeLists.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,16 +90,16 @@ configure_file(
9090

9191
install(TARGETS ${PROJECT_NAME} DESTINATION /usr/sbin)
9292

93-
if(VERSION_FILE)
94-
execute_process(
95-
COMMAND bash -c "echo -n ${CMAKE_PROJECT_VERSION}-${git_version} > VERSION"
96-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
97-
)
93+
if(GIT_VERSION)
94+
set(git_version ${GIT_VERSION})
9895
endif()
9996

10097
if(ARMHF_DEB)
10198

102-
set(ARCHITECTURE "armhf")
99+
if(ARCHITECTURE)
100+
else()
101+
EXECUTE_PROCESS( COMMAND uname -m COMMAND tr -d '\n' OUTPUT_VARIABLE ARCHITECTURE)
102+
endif()
103103
set(CPACK_GENERATOR "DEB")
104104
set(CPACK_SOURCE_GENERATOR "TGZ")
105105
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Shreyas Atre")

VERSION

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)