Skip to content

Commit

Permalink
update night github actino
Browse files Browse the repository at this point in the history
  • Loading branch information
williamhCode committed Dec 22, 2024
1 parent 83dfdfa commit cc981a1
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 32 deletions.
31 changes: 6 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,14 @@ jobs:
-DSDL_SHARED=OFF
-DSDL_STATIC=ON
-DBLEND2D_STATIC=ON
$([[ "${{ github.event.inputs.nightly }}" == "true" ]] && echo "-DDEV_BUILD=ON" || echo "")
- name: Build neogurt
run: cmake --build build/release --target neogurt

- name: Generate package
run: make package

- name: Rename DMG for nightly
if: ${{ github.event.inputs.nightly == 'true' }}
run: |
cd build/release
COMMIT_HASH=$(git rev-parse --short HEAD)
mv Neogurt*.dmg Neogurt-${COMMIT_HASH}.dmg
- name: Prepare artifacts
run: |
cd build/release
Expand All @@ -78,19 +72,6 @@ jobs:
name: ${{ env.ARTIFACT_NAME }}
path: build/release/${{ env.ARTIFACT_NAME }}

# - name: Create release for nightly
# if: ${{ github.event.inputs.nightly == 'true' }}
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# run: |
# TAG_NAME="nightly-$(date +%Y-%m-%d)"
# RELEASE_NAME="Nightly Build $(date +%Y-%m-%d)"
# FILE_PATH="build/release/${{ env.ARTIFACT_NAME }}"
# gh release create $TAG_NAME $FILE_PATH \
# --title "$RELEASE_NAME" \
# --notes "Nightly build for commit ${{ github.sha }}" \
# --prerelease

create-release:
if: ${{ github.event.inputs.nightly == 'true' }}
needs: build
Expand All @@ -107,9 +88,9 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
TAG_NAME="nightly-$(date +'%Y-%m-%d')"
RELEASE_NAME="Nightly Build $(date +'%Y-%m-%d')"
gh release create $TAG_NAME artifacts/* \
--title "$RELEASE_NAME" \
--notes "Nightly build for commit ${{ github.sha }}" \
gh release delete nightly --yes || true
git push origin :nightly || true
gh release create nightly artifacts/* \
--title "Neogurt dev build" \
--notes "Dev build for commit ${{ github.sha }}" \
--prerelease
24 changes: 20 additions & 4 deletions CmakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,24 @@ set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum OS X deployment ver

project(
Neogurt
VERSION 0.1.4
VERSION 0.1.5
DESCRIPTION "A Neovim GUI Smooth like Yogurt!"
LANGUAGES C CXX
)

if (DEV_BUILD)
execute_process(
COMMAND git rev-parse --short HEAD
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

set(PROJECT_VERSION_SUFFIX "dev")
set(PROJECT_VERSION_COMMIT ${GIT_COMMIT_HASH})
set(PROJECT_VERSION "${PROJECT_VERSION}-${PROJECT_VERSION_SUFFIX}-${PROJECT_VERSION_COMMIT}")
endif()

# fix https://gitlab.kitware.com/cmake/cmake/-/issues/24104
enable_language(OBJC)

Expand Down Expand Up @@ -87,9 +100,12 @@ add_executable(neogurt ${APP_SRC})

target_compile_definitions(neogurt PRIVATE
VERSION="${PROJECT_VERSION}"
MAJOR_VERSION="${PROJECT_VERSION_MAJOR}"
MINOR_VERSION="${PROJECT_VERSION_MINOR}"
PATCH_VERSION="${PROJECT_VERSION_PATCH}"
VERSION_MAJOR="${PROJECT_VERSION_MAJOR}"
VERSION_MINOR="${PROJECT_VERSION_MINOR}"
VERSION_PATCH="${PROJECT_VERSION_PATCH}"
VERSION_SUFFIX="${PROJECT_VERSION_SUFFIX}"
VERSION_COMMIT="${PROJECT_VERSION_COMMIT}"

ROOT_DIR="${PROJECT_SOURCE_DIR}"
)

Expand Down
8 changes: 5 additions & 3 deletions src/nvim/nvim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ void Nvim::Setup() {
SetClientInfo(
"neogurt",
{
{"major", MAJOR_VERSION},
{"minor", MINOR_VERSION},
{"patch", PATCH_VERSION},
{"major", VERSION_MAJOR},
{"minor", VERSION_MINOR},
{"patch", VERSION_PATCH},
{"prerelease", VERSION_SUFFIX},
{"commit", VERSION_COMMIT},
},
"ui", {}, {}
)
Expand Down

0 comments on commit cc981a1

Please sign in to comment.