Skip to content

Commit

Permalink
Add Github Actions to build and release packages
Browse files Browse the repository at this point in the history
  • Loading branch information
timower committed Jan 26, 2021
1 parent cc84394 commit 2e59db3
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/toltec-dev/base:v1.3

steps:
- uses: actions/checkout@v2

- name: Create Build Environment
run: |
cmake -E make_directory build
cmake -E make_directory install
- name: Configure CMake
run: |
cd build
cmake $GITHUB_WORKSPACE -DCMAKE_TOOLCHAIN_FILE="/usr/share/cmake/$CHOST.cmake" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$PWD/../install
- name: Build
run: cd build && cmake --build .

- name: Install
run: cd build && cmake --build . --target install

- name: Package
run: cd install && tar -czvf package.tar.gz *

- name: Upload
uses: actions/upload-artifact@v2
with:
name: package
path: install/package.tar.gz
release:
runs-on: ubuntu-latest
needs: build
if: ${{ startsWith(github.ref, 'refs/tags/v') }}

steps:
- name: Download package
id: download_package
uses: actions/download-artifact@v2
with:
name: package
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: true
- run: ls -la
- name: Upload Release Package
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: package.tar.gz
asset_name: package.tar.gz
asset_content_type: application/gzip


2 changes: 2 additions & 0 deletions apps/launcher/CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
target_link_libraries(${PROJECT_NAME}
PRIVATE
rMlib)

install(TARGETS ${PROJECT_NAME} DESTINATION bin)
2 changes: 2 additions & 0 deletions apps/tilem/CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ target_link_libraries(${PROJECT_NAME}
PRIVATE
tiemu
rMlib)

install(TARGETS ${PROJECT_NAME} DESTINATION bin)
6 changes: 6 additions & 0 deletions apps/yaft/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
target_link_libraries(${PROJECT_NAME}
PRIVATE
rMlib)

add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND tic ${CMAKE_CURRENT_SOURCE_DIR}/info/yaft.src -o ${CMAKE_BINARY_DIR}/terminfo)

install(TARGETS ${PROJECT_NAME} DESTINATION bin)
install(DIRECTORY ${CMAKE_BINARY_DIR}/terminfo DESTINATION etc)
11 changes: 11 additions & 0 deletions libs/rMlib/CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ find_path(LIBEVDEV_INCLUDE_DIR libevdev.h
HINTS "$ENV{SDKTARGETSYSROOT}/usr/include"
REQUIRED)

set(RMLIB_INCLUDES
include/Canvas.h
include/Device.h
include/FrameBuffer.h
include/Graphics.h
include/Input.h
include/MathUtil.h)

add_library(${PROJECT_NAME} STATIC
Input.cpp
Device.cpp
Expand All @@ -27,3 +35,6 @@ target_link_libraries(${PROJECT_NAME}
PRIVATE ${LIBEVDEV_LIBRARY})

target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)

install(TARGETS ${PROJECT_NAME} DESTINATION lib)
install(FILES ${RMLIB_INCLUDES} DESTINATION include/rmlib)

0 comments on commit 2e59db3

Please sign in to comment.