CI: Enable the uploading of packaged build artifacts
This commit is contained in:
parent
67802a4d6f
commit
2cf5320799
|
@ -10,13 +10,15 @@ jobs:
|
|||
run: apt update; apt install -y libusb-1.0-0-dev cmake
|
||||
- name: Check out repository code
|
||||
uses: ischanx/checkout@8c80eac3058d03dc5301629e8f7d59ae255d6cc3
|
||||
- name: Version
|
||||
id: version
|
||||
run: git fetch -a; echo "tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_OUTPUT
|
||||
- name: Build
|
||||
run: mkdir ${{ gitea.workspace }}/build; cd ${{ gitea.workspace }}/build; cmake -DCMAKE_BUILD_TYPE=Release ..; make
|
||||
run: mkdir ${{ gitea.workspace }}/build; cd ${{ gitea.workspace }}/build; cmake -DCMAKE_BUILD_TYPE=Release -DGIT_TAG=${{ steps.version.outputs.tag }} ..; make
|
||||
- name: Package
|
||||
run: cd ${{ gitea.workspace }}/build; make package
|
||||
- name: Upload artifacts
|
||||
uses: https://gitea.com/actions/upload-artifact.git@v4.6.2
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: package-linux
|
||||
path: eismultiplexer-linux-*.zip
|
||||
|
||||
name: eismultiplexer-linux-x86_64-${{ steps.version.outputs.tag }}
|
||||
path: ${{ gitea.workspace }}/build/packaged/${{ steps.version.outputs.tag }}/*
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
function(get_version_from_git)
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
if(NOT GIT_TAG)
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} describe --tags --always
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
|
@ -8,17 +9,10 @@ function(get_version_from_git)
|
|||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
RESULT_VARIABLE GIT_RESULT
|
||||
)
|
||||
|
||||
if(NOT GIT_RESULT EQUAL 0)
|
||||
message(FATAL_ERROR "Failed to get git tag")
|
||||
endif()
|
||||
|
||||
execute_process(
|
||||
COMMAND ${GIT_EXECUTABLE} rev-parse --short=7 HEAD
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
OUTPUT_VARIABLE GIT_COMMIT_SHORT_HASH
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
)
|
||||
endif()
|
||||
|
||||
string(REGEX REPLACE "^v" "" CLEAN_TAG "${GIT_TAG}")
|
||||
if(CLEAN_TAG MATCHES "^([0-9]+)\\.([0-9]+)\\.([0-9]+)(-.*)?$")
|
||||
|
|
Loading…
Reference in a new issue