Skip to content

Commit

Permalink
updated release config
Browse files Browse the repository at this point in the history
  • Loading branch information
mariotaku committed Dec 26, 2022
1 parent 1261e65 commit abe44a4
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 7 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release

on:
release:
types: [ created ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Debug

jobs:
build-webos:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install webOS NDK
id: webos-ndk
uses: webosbrew/setup-webos-ndk-action@main

- name: Install webOS CLI & Compatibility checker
run: sudo npm install -g @webosose/ares-cli @webosbrew/pub-utils

- name: Build
env:
TOOLCHAIN_FILE: ${{steps.webos-ndk.outputs.cmake-toolchain}}
run: ./tools/webos/easy_build.sh -DCMAKE_BUILD_TYPE=$BUILD_TYPE

- name: Create Release (webOS)
id: create_release_webos
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Release ${{ steps.tagName.outputs.tag }}
allowUpdates: true
omitNameDuringUpdate: true
omitBodyDuringUpdate: true
omitPrereleaseDuringUpdate: true
artifacts: dist/*.ipk,dist/*.manifest.json
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.16)

project(ihsplay VERSION 0.0.1 LANGUAGES C)
project(ihsplay VERSION 0.1.0 LANGUAGES C)

enable_testing()

Expand Down
15 changes: 14 additions & 1 deletion cmake/AresPackage.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
execute_process(COMMAND ares-package "${CPACK_TEMPORARY_DIRECTORY}" -o "${CPACK_PACKAGE_DIRECTORY}")
execute_process(COMMAND ares-package "${CPACK_TEMPORARY_DIRECTORY}" -o "${CPACK_PACKAGE_DIRECTORY}")

find_program(GEN_MANIFEST_CMD webosbrew-gen-manifest)
if (GEN_MANIFEST_CMD)
execute_process(COMMAND "${GEN_MANIFEST_CMD}"
-a "${CPACK_TEMPORARY_DIRECTORY}/appinfo.json"
-p "${CPACK_PACKAGE_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}.ipk"
-o "${CPACK_PACKAGE_DIRECTORY}/${CPACK_PACKAGE_NAME}.manifest.json"
-i "https://github.com/mariotaku/ihsplay/raw/master/deploy/webos/largeIcon.png"
-l "https://github.com/mariotaku/ihsplay"
)
else ()
message("Skip webOS homebrew manifest generation because command line tool is not found")
endif ()
10 changes: 7 additions & 3 deletions cmake/PackageWebOS.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
install(TARGETS ihsplay RUNTIME DESTINATION .)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/deploy/webos/ DESTINATION .)

set(CPACK_PACKAGE_NAME "org.mariotaku.ihsplay")
set(CPACK_GENERATOR "External")
set(CPACK_EXTERNAL_PACKAGE_SCRIPT "${CMAKE_SOURCE_DIR}/cmake/AresPackage.cmake")
Expand All @@ -9,6 +6,13 @@ set(CPACK_MONOLITHIC_INSTALL TRUE)
set(CPACK_PACKAGE_DIRECTORY ${CMAKE_SOURCE_DIR}/dist)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${PROJECT_VERSION}_$ENV{ARCH}")

# Copy manifest
configure_file(deploy/webos/appinfo.json.in ./appinfo.json @ONLY)

install(TARGETS ihsplay RUNTIME DESTINATION .)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/deploy/webos/ DESTINATION . PATTERN ".*" EXCLUDE PATTERN "*.in" EXCLUDE)
install(FILES "${CMAKE_BINARY_DIR}/appinfo.json" DESTINATION .)

# Will use all cores on CMake 3.20+
set(CPACK_THREADS 0)

Expand Down
4 changes: 2 additions & 2 deletions deploy/webos/appinfo.json → deploy/webos/appinfo.json.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"id": "org.mariotaku.ihsplay",
"id": "@CPACK_PACKAGE_NAME@",
"type": "native",
"main": "ihsplay",
"icon": "icon.png",
"largeIcon": "largeIcon.png",
"iconColor": "#ffffff",
"title": "IHSplay",
"version": "0.0.1"
"version": "@PROJECT_VERSION@"
}

0 comments on commit abe44a4

Please sign in to comment.