Skip to content

Commit

Permalink
New CI/CD using Github Actions (Segs#949)
Browse files Browse the repository at this point in the history
Add new CI/CD pipelines using github action
  • Loading branch information
miles200 authored May 2, 2022
1 parent da12949 commit 0e8aa99
Show file tree
Hide file tree
Showing 9 changed files with 258 additions and 147 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/SegsCI.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: segs-ci-pull-request

on:
pull_request:
branches: [ develop ]

env:
BUILD_TYPE: Debug
QT_VERSION: "5.15.2"
QT_WIN_TARGET_ARCHITECTURE: "win64_msvc2019_64"

jobs:
build-windows:
runs-on: 'windows-latest'
steps:
- uses: actions/checkout@v3

- name: Install Qt Windows
uses: jurplel/install-qt-action@v2.14.0
with:
host: windows
target: desktop
version: ${{ env.QT_VERSION }}
arch: ${{ env.QT_WIN_TARGET_ARCHITECTURE }}
dir: "${{ github.workspace }}/qt"
install-deps: "true"

- name: Configure CMake Windows
env:
CMAKE_PREFIX_PATH: ${{ env.Qt5_Dir }}
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build Windows
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }}

build-linux:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v3

- name: Install Qt Linux
uses: jurplel/install-qt-action@v2.14.0
with:
host: linux
target: desktop
version: ${{ env.QT_VERSION }}
dir: "${{ github.workspace }}/qt"
install-deps: "true"

- name: Configure CMake Linux
env:
CMAKE_PREFIX_PATH: ${{ env.Qt5_Dir }}
CXX: "/usr/bin/clang++"
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }}

build-macos:
runs-on: 'macos-latest'
steps:
- uses: actions/checkout@v3

- name: Install Qt MacOS
uses: jurplel/install-qt-action@v2.14.0
with:
host: mac
target: desktop
version: ${{ env.QT_VERSION }}
dir: "${{ github.workspace }}/qt"
install-deps: "true"

- name: Configure CMake MacOS
env:
CMAKE_PREFIX_PATH: ${{ env.Qt5_Dir }}
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }}
172 changes: 172 additions & 0 deletions .github/workflows/SegsNightlyRelease.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
name: segs-ci-nightly


on:
schedule:
- cron: '0 17 * * *'

env:
BUILD_TYPE: Debug
QT_VERSION: "5.15.2"
QT_WIN_TARGET_ARCHITECTURE: "win64_msvc2019_64"

jobs:

tidy-up-releases: # Delete the currently nightly release and create a new one.
runs-on: 'ubuntu-latest'
permissions:
contents: write
steps:

- name: Delete Current Nightly Release
uses: dev-drprasad/delete-tag-and-release@v0.2.0
with:
delete_release: true
tag_name: "nightly"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create New Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: "true"
commit: ${{ github.sha }}
tag: "nightly"
name: "Nightly Development Release"
body: |
Commit reference: ${{ github.sha }}
Built on branch: ${{ github.ref_name }}
build-windows:
needs: tidy-up-releases
runs-on: 'windows-latest'
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- name: Install Qt Windows
uses: jurplel/install-qt-action@v2.14.0
with:
host: windows
target: desktop
version: ${{ env.QT_VERSION }}
arch: ${{ env.QT_WIN_TARGET_ARCHITECTURE }}
dir: "${{ github.workspace }}/qt"
install-deps: "true"

- name: Configure CMake Windows
env:
CMAKE_PREFIX_PATH: ${{ env.Qt5_Dir }}
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build Windows
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }}

- name: Get OpenSSL Libraries # Download OpenSSL 1.1.1 and extract required dlls, copy to out directory for SEGSAdmin.
continue-on-error: true # Robocopy uses an exit code 1 on successful copy which causes the step to fail. Allowing this step to continue even if reported as failure.
run: |
mkdir ${{ github.workspace }}\build\openssl
curl -o ${{ github.workspace }}\build\openssl\openssl.zip https://mirror.firedaemon.com/OpenSSL/openssl-1.1.1n.zip
tar -xf ${{ github.workspace }}\build\openssl\openssl.zip -C ${{ github.workspace }}\build\openssl
robocopy ${{ github.workspace }}\build\openssl\openssl-1.1\x64\bin\ ${{ github.workspace }}\build\out *.dll
- name: Create Windows Archive
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ${{ github.workspace }}/build/out
filename: 'windows-release-x64.zip'
exclusions: '*.git*'

- name: Deploy Windows Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: "true"
tag: "nightly"
artifacts: ${{ github.workspace }}/build/out/windows-release-x64.zip

build-linux:
needs: tidy-up-releases
runs-on: 'ubuntu-latest'
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- name: Install Qt Linux
uses: jurplel/install-qt-action@v2.14.0
with:
host: linux
target: desktop
version: ${{ env.QT_VERSION }}
dir: "${{ github.workspace }}/qt"
install-deps: "true"

- name: Configure CMake Linux
env:
CMAKE_PREFIX_PATH: ${{ env.Qt5_Dir }}
CXX: "/usr/bin/clang++"
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build Linux
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }}

- name: Create Linux Archive
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ${{ github.workspace }}/build/out
filename: 'linux-release-x64.zip'
exclusions: '*.git*'

- name: Deploy Linux Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: "true"
tag: "nightly"
artifacts: ${{ github.workspace }}/build/out/linux-release-x64.zip

build-macos:
needs: tidy-up-releases
runs-on: 'macos-latest'
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- name: Install Qt MacOS
uses: jurplel/install-qt-action@v2.14.0
with:
host: mac
target: desktop
version: ${{ env.QT_VERSION }}
dir: "${{ github.workspace }}/qt"
install-deps: "true"

- name: Configure CMake MacOS
env:
CMAKE_PREFIX_PATH: ${{ env.Qt5_Dir }}
run: cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }}

- name: Build MacOS
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }}

- name: Create MacOS Archive
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: ${{ github.workspace }}/build/out
filename: 'macos-release-x64.zip'
exclusions: '*.git*'

- name: Deploy MacOS Release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: "true"
tag: "nightly"
artifacts: ${{ github.workspace }}/build/out/macos-release-x64.zip
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,7 @@ Temp/
# Environment activation script
activate.env
.directory

# Visual Studio
*.cache
CMakeSettings.json
100 changes: 0 additions & 100 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeScripts;${CMAKE_MODULE_PATH})
set(CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/3rd_party/prebuilt")
set(UNICODE TRUE)
set(INSTALLED_TARGETS)
option(ENABLE_SCRIPTING_ENGINE "Build experimental scripting engine ?" ON)
option(ENABLE_SCRIPTING_ENGINE "Build experimental scripting engine ?" ON) # Disabled temporarily until sol2 library fixed for macOS
option(ENABLE_TESTS "Enable testing unit and functional tests" OFF)
option(BUILD_COX_MAP_VIEWER "Build CoX map file viewer ?" OFF)
option(BUILD_RPC_TEST_CLIENT "Build RPC Test Client ?" OFF)
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
<img src="docs/segs-medallion-med.png" align="right" alt="SEGS Logo">

[![Discord](https://img.shields.io/discord/242088237596803073.svg?label=&logo=discord&logoColor=ffffff&color=7389D8&labelColor=6A7EC2)](https://discord.segs.dev)
[![master Build Status](https://travis-ci.com/Segs/Segs.svg)](https://travis-ci.org/Segs/Segs)
[![master Build Status](https://ci.appveyor.com/api/projects/status/github/segs/segs?svg=true)](https://ci.appveyor.com/project/nemerle/Segs)
[![SEGS-CI](https://github.com/Segs/Segs/actions/workflows/segs-github-ci.yaml/badge.svg)](https://github.com/Segs/Segs/actions/workflows/segs-github-ci.yaml)
[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/SEGS/segs.svg)](http://isitmaintained.com/project/SEGS/segs "Average time to resolve an issue")
[![Percentage of issues still open](http://isitmaintained.com/badge/open/SEGS/segs.svg)](http://isitmaintained.com/project/SEGS/segs "Percentage of issues still open")

Expand Down
1 change: 1 addition & 0 deletions Servers/MapServer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ target_link_libraries(MapServer PUBLIC CRUDP_Protocol common_runtime)
target_link_libraries(MapServer PUBLIC Qt5::Core)
target_link_libraries(MapServer PUBLIC gameData)


add_subdirectory(ScriptingEngine)
add_subdirectory(SlashCommands)

Expand Down
1 change: 0 additions & 1 deletion Servers/MapServer/ScriptingEngine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

SET(target_CPP
ScriptingEngine.cpp
ScriptingEngine_CharacterTypes.cpp
Expand Down
Loading

0 comments on commit 0e8aa99

Please sign in to comment.