From 4d020e4f948e608a44d8590d1178cd211a5cfeed Mon Sep 17 00:00:00 2001 From: s4016080-ps1nov Date: Thu, 29 Aug 2024 19:03:49 +1000 Subject: [PATCH 1/3] fix workflow issues --- .github/workflows/package-release.yml | 17 +++++------------ CMakeLists.txt | 4 ---- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index eb4c4f22..29aea2d6 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -2,13 +2,7 @@ name: package-release on: push: - paths-ignore: - - "README.md" - - "LICENSE" - - "Doxyfile" - - "doxygen-awesome" - - pull_request: + branches: 'version-**' paths-ignore: - "README.md" - "LICENSE" @@ -35,7 +29,6 @@ jobs: strategy: fail-fast: false matrix: - build-type: [Release] distro: [stable] needs: check_commit_message if: ${{ contains(needs.check_commit_message.outputs.commit_message, 'RELEASE') }} @@ -55,7 +48,7 @@ jobs: id: get_version shell: bash run: | - VERSION=$(echo $GITHUB_REF_NAME | cut -d - -f 2) + VERSION=$(echo $GITHUB_REF_NAME | cut -d - -f 2) echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - name: Checking out sources @@ -69,7 +62,7 @@ jobs: run: | mkdir build cd build - cmake .. -GNinja -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DPROJECT_VERSION=${{ steps.get_version.outputs.VERSION }} + cmake .. -GNinja -DPROJECT_VERSION=${{ steps.get_version.outputs.VERSION }} echo "VERSION=${{ steps.get_version.outputs.VERSION }}" - name: Build @@ -87,7 +80,7 @@ jobs: - name: Upload artifacts uses: actions/upload-artifact@v4 with: - name: mcpp-${{ steps.get_version.outputs.VERSION }}-debian-${{ matrix.distro }}-${{ matrix.build-type }}.deb + name: mcpp-${{ steps.get_version.outputs.VERSION }}-debian-${{ matrix.distro }}.deb path: build/${{ steps.get_package.outputs.NAME }} - name: Create tag @@ -100,7 +93,7 @@ jobs: with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: build/${{ steps.get_package.outputs.NAME }} - asset_name: mcpp-${{ steps.get_version.outputs.VERSION }}-debian-${{ matrix.distro }}-${{ matrix.build-type }}.deb + asset_name: mcpp-${{ steps.get_version.outputs.VERSION }}-debian-${{ matrix.distro }}.deb tag: release-${{ steps.get_version.outputs.VERSION }} overwrite: true diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bc6115c..f144a187 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,5 @@ cmake_minimum_required(VERSION 3.16) -# Check if PROJECT_VERSION is already defined, otherwise set a default -if(NOT DEFINED PROJECT_VERSION) - set(PROJECT_VERSION 1.0.0) -endif() project(mcpp VERSION ${PROJECT_VERSION}) From 7219fdd3fc55f407cc792556dea46fada1e23748 Mon Sep 17 00:00:00 2001 From: s4016080-ps1nov Date: Fri, 30 Aug 2024 00:02:05 +1000 Subject: [PATCH 2/3] Fix ci error --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f144a187..0d8f54bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,11 @@ project(mcpp VERSION ${PROJECT_VERSION}) set(CMAKE_CXX_STANDARD 17) +# Check if PROJECT_VERSION is already defined, otherwise set a default +if(NOT DEFINED PROJECT_VERSION) + set(PROJECT_VERSION 1.0.0) +endif() + if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() From ca456adcafe442433d0611d4af474200bef79948 Mon Sep 17 00:00:00 2001 From: s4016080-ps1nov Date: Fri, 30 Aug 2024 00:05:09 +1000 Subject: [PATCH 3/3] Fix version error --- CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0d8f54bc..5bc6115c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,15 +1,14 @@ cmake_minimum_required(VERSION 3.16) - -project(mcpp VERSION ${PROJECT_VERSION}) - -set(CMAKE_CXX_STANDARD 17) - # Check if PROJECT_VERSION is already defined, otherwise set a default if(NOT DEFINED PROJECT_VERSION) set(PROJECT_VERSION 1.0.0) endif() +project(mcpp VERSION ${PROJECT_VERSION}) + +set(CMAKE_CXX_STANDARD 17) + if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif()