Skip to content

Commit 2900802

Browse files
authored
Merge pull request #38 from rpgppengine/main
Implement building workflow to the lua-api branch
2 parents 02c375e + d3504c9 commit 2900802

3 files changed

Lines changed: 121 additions & 44 deletions

File tree

.github/workflows/build.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: "Build RPG++"
2+
3+
on:
4+
push:
5+
branches: ["main", "ci-cd"]
6+
pull_request:
7+
branches: ["main", "ci-cd"]
8+
schedule:
9+
- cron: "19 2 * * 1"
10+
workflow_dispatch:
11+
12+
env:
13+
BUILD_DIR: build
14+
RETENTION_DAYS: 7
15+
BUILD_TYPE: debug
16+
17+
jobs:
18+
build-linux:
19+
name: "build: linux"
20+
runs-on: 'ubuntu-latest'
21+
env:
22+
PLATFORM: linux
23+
ARCH: x86_64
24+
steps:
25+
- name: Checkout repository
26+
uses: actions/checkout@v6
27+
with:
28+
fetch-depth: 0
29+
submodules: recursive
30+
31+
- name: Install packages
32+
shell: bash
33+
run: |
34+
sudo add-apt-repository ppa:xmake-io/xmake
35+
sudo apt-get update
36+
sudo apt-get install -y \
37+
libx11-dev \
38+
libxrandr-dev \
39+
libxinerama-dev \
40+
libxcursor-dev \
41+
libxi-dev \
42+
libgl1-mesa-dev \
43+
mesa-common-dev \
44+
xmake
45+
46+
- name: Build
47+
shell: bash
48+
run: |
49+
xmake build --all -y
50+
51+
- name: Upload artifact
52+
uses: actions/upload-artifact@v6
53+
with:
54+
name: linux-build
55+
path: ${{ env.BUILD_DIR }}/${{ env.PLATFORM }}/${{ env.ARCH }}/${{ env.BUILD_TYPE }}/ # adjust to your xmake output path
56+
if-no-files-found: error
57+
retention-days: ${{ env.RETENTION_DAYS }}
58+
build-windows:
59+
name: "build: windows"
60+
runs-on: windows-latest
61+
env:
62+
PLATFORM: windows
63+
ARCH: x64
64+
steps:
65+
- name: Checkout repository
66+
uses: actions/checkout@v6
67+
with:
68+
fetch-depth: 0
69+
submodules: recursive
70+
71+
- name: Install xmake
72+
uses: xmake-io/github-action-setup-xmake@v1
73+
with:
74+
xmake-version: latest
75+
76+
- name: Build
77+
shell: pwsh
78+
run: xmake build --all -y
79+
80+
- name: Upload artifact
81+
uses: actions/upload-artifact@v6
82+
with:
83+
name: windows-build
84+
path: ${{ env.BUILD_DIR }}/${{ env.PLATFORM }}/${{ env.ARCH }}/${{ env.BUILD_TYPE }}/
85+
if-no-files-found: error
86+
retention-days: ${{ env.RETENTION_DAYS }}
87+
88+
build-macos:
89+
name: "build: macos"
90+
runs-on: macos-latest
91+
env:
92+
PLATFORM: macosx
93+
ARCH: arm64
94+
steps:
95+
- name: Checkout repository
96+
uses: actions/checkout@v6
97+
with:
98+
fetch-depth: 0
99+
submodules: recursive
100+
101+
- name: Install xmake
102+
uses: xmake-io/github-action-setup-xmake@v1
103+
104+
- name: Build
105+
shell: bash
106+
run: xmake build --all -y
107+
108+
- name: Upload artifact
109+
uses: actions/upload-artifact@v6
110+
with:
111+
name: macos-build
112+
path: ${{ env.BUILD_DIR }}/${{ env.PLATFORM }}/${{ env.ARCH }}/${{ env.BUILD_TYPE }}/
113+
if-no-files-found: error
114+
retention-days: ${{ env.RETENTION_DAYS }}

.github/workflows/codeql.yml

Lines changed: 2 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,16 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
121
name: "CodeQL Advanced"
132

143
on:
154
push:
16-
branches: ["main", "tgui-fresh"]
5+
branches: ["main"]
176
pull_request:
18-
branches: ["main", "tgui-fresh"]
7+
branches: ["main"]
198
schedule:
209
- cron: "19 2 * * 1"
2110

2211
jobs:
2312
analyze:
2413
name: Analyze (${{ matrix.language }})
25-
# Runner size impacts CodeQL analysis time. To learn more, please see:
26-
# - https://gh.io/recommended-hardware-resources-for-running-codeql
27-
# - https://gh.io/supported-runners-and-hardware-resources
28-
# - https://gh.io/using-larger-runners (GitHub.com only)
29-
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
3014
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
3115
permissions:
3216
# required for all workflows
@@ -45,46 +29,20 @@ jobs:
4529
include:
4630
- language: c-cpp
4731
build-mode: manual
48-
# CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
49-
# Use `c-cpp` to analyze code written in C, C++ or both
50-
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
51-
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
52-
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
53-
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
54-
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
55-
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
5632
steps:
5733
- name: Checkout repository
5834
uses: actions/checkout@v4
5935
with:
6036
fetch-depth: 0
6137
submodules: recursive
6238

63-
# Add any setup steps before running the `github/codeql-action/init` action.
64-
# This includes steps like installing compilers or runtimes (`actions/setup-node`
65-
# or others). This is typically only required for manual builds.
66-
# - name: Setup runtime (example)
67-
# uses: actions/setup-example@v1
68-
6939
# Initializes the CodeQL tools for scanning.
7040
- name: Initialize CodeQL
7141
uses: github/codeql-action/init@v4
7242
with:
7343
languages: ${{ matrix.language }}
7444
build-mode: ${{ matrix.build-mode }}
75-
# If you wish to specify custom queries, you can do so here or in a config file.
76-
# By default, queries listed here will override any specified in a config file.
77-
# Prefix the list here with "+" to use these queries and those in the config file.
78-
79-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
80-
# queries: security-extended,security-and-quality
8145

82-
# If the analyze step fails for one of the languages you are analyzing with
83-
# "We were unable to automatically build your code", modify the matrix above
84-
# to set the build mode to "manual" for that language. Then modify this step
85-
# to build your code.
86-
# ℹ️ Command-line programs to run using the OS shell.
87-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
8846
- name: Run manual build steps
8947
if: matrix.build-mode == 'manual'
9048
shell: bash

xmake.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,9 @@ after_build( function (target)
162162
-- remove this line to test if the configuration file changes
163163
os.cp("$(curdir)/rpgpp.ini", "$(builddir)/$(plat)/$(arch)/$(mode)/", { copy_if_different = true })
164164
print("Pro tip: Check whether translations are up to date with `xmake check_translation`!")
165+
print("Environment:")
166+
print(" builddir: " .. "$(builddir)")
167+
print(" plat: " .. "$(plat)")
168+
print(" arch: " .. "$(arch)")
169+
print(" mode: " .. "$(mode)")
165170
end)

0 commit comments

Comments
 (0)