Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix workflow issues #78

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix workflow issues
  • Loading branch information
johnathanchann committed Aug 29, 2024
commit 4d020e4f948e608a44d8590d1178cd211a5cfeed
17 changes: 5 additions & 12 deletions .github/workflows/package-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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') }}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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})

Expand Down
Loading