Skip to content

Commit

Permalink
Add package CI on "v*" tag push.
Browse files Browse the repository at this point in the history
  • Loading branch information
karnkaul committed Jul 5, 2024
1 parent 5c20c2d commit f0b6ad6
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: package
on:
push:
tags:
- 'v*'
env:
APP_NAME: NovaSwarm
jobs:
package-linux:
runs-on: ubuntu-24.04
env:
CPU_ARCH: x64
OS_NAME: linux
PACKAGE_NAME: $APP_NAME-$CPU_ARCH-$OS_NAME-v0.1.0.zip
steps:
- uses: actions/checkout@v4
- name: init
run: sudo apt update -yqq && sudo apt install -yqq ninja-build xorg-dev
- name: package release
run: cmake -DPACKAGE_NAME=$PACKAGE_NAME -P tools/package_release.cmake
- name: upload release
uses: softprops/action-gh-release@v2
with:
files: $PACKAGE_NAME
draft: true
package-windows:
runs-on: windows-latest
env:
CPU_ARCH: x64
OS_NAME: windows
PACKAGE_NAME: $env:APP_NAME-$env:CPU_ARCH-$env:OS_NAME-v0.1.0.zip
steps:
- uses: actions/checkout@v4
- name: init
run: chocolatey install ninja
- name: package release
run: cmake -DPACKAGE_NAME=$env:PACKAGE_NAME -P tools/package_release.cmake
- name: upload release
uses: softprops/action-gh-release@v2
with:
files: $PACKAGE_NAME
draft: true
package-macos:
runs-on: macos-latest
env:
CPU_ARCH: arm64
OS_NAME: macos
PACKAGE_NAME: $APP_NAME-$CPU_ARCH-$OS_NAME-v0.1.0.zip
steps:
- uses: actions/checkout@v4
- name: init
run: brew install ninja
- name: package release
run: cmake -DPACKAGE_NAME=$PACKAGE_NAME -P tools/package_release.cmake
- name: upload release
uses: softprops/action-gh-release@v2
with:
files: $PACKAGE_NAME
draft: true

2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ message(STATUS "spaced build version: ${build_version}")

project(spaced VERSION ${build_version})

configure_file(src/package.yml.in "${CMAKE_CURRENT_SOURCE_DIR}/.github/workflows/package.yml" @ONLY)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Expand Down
60 changes: 60 additions & 0 deletions src/package.yml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: package
on:
push:
tags:
- 'v*'
env:
APP_NAME: NovaSwarm
jobs:
package-linux:
runs-on: ubuntu-24.04
env:
CPU_ARCH: x64
OS_NAME: linux
PACKAGE_NAME: $APP_NAME-$CPU_ARCH-$OS_NAME-v@[email protected]
steps:
- uses: actions/checkout@v4
- name: init
run: sudo apt update -yqq && sudo apt install -yqq ninja-build xorg-dev
- name: package release
run: cmake -DPACKAGE_NAME=$PACKAGE_NAME -P tools/package_release.cmake
- name: upload release
uses: softprops/action-gh-release@v2
with:
files: $PACKAGE_NAME
draft: true
package-windows:
runs-on: windows-latest
env:
CPU_ARCH: x64
OS_NAME: windows
PACKAGE_NAME: $env:APP_NAME-$env:CPU_ARCH-$env:OS_NAME-v@[email protected]
steps:
- uses: actions/checkout@v4
- name: init
run: chocolatey install ninja
- name: package release
run: cmake -DPACKAGE_NAME=$env:PACKAGE_NAME -P tools/package_release.cmake
- name: upload release
uses: softprops/action-gh-release@v2
with:
files: $PACKAGE_NAME
draft: true
package-macos:
runs-on: macos-latest
env:
CPU_ARCH: arm64
OS_NAME: macos
PACKAGE_NAME: $APP_NAME-$CPU_ARCH-$OS_NAME-v@[email protected]
steps:
- uses: actions/checkout@v4
- name: init
run: brew install ninja
- name: package release
run: cmake -DPACKAGE_NAME=$PACKAGE_NAME -P tools/package_release.cmake
- name: upload release
uses: softprops/action-gh-release@v2
with:
files: $PACKAGE_NAME
draft: true

0 comments on commit f0b6ad6

Please sign in to comment.