-
Notifications
You must be signed in to change notification settings - Fork 793
76 lines (65 loc) · 2.05 KB
/
xbox_nxdk.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Xbox
on:
push:
branches:
- master
paths-ignore:
- '*.md'
- 'docs/**'
pull_request:
types: [opened, synchronize]
paths-ignore:
- '*.md'
- 'docs/**'
release:
types: [published]
paths-ignore:
- '*.md'
- 'docs/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
xbox:
# `ubuntu-latest` is currently 20.04 but we require a newer clang.
runs-on: ubuntu-22.04
env:
NXDK_DIR: /opt/nxdk
steps:
- name: Install APT packages
run: sudo apt-get update && sudo apt-get install -y clang llvm lld bison flex cmake git gettext
- name: Clone nxdk Repo
shell: bash
run: git clone --recursive --depth 1 https://github.com/XboxDev/nxdk.git "$NXDK_DIR"
- name: Build nxdk
shell: bash
run: PATH="${NXDK_DIR}/bin:$PATH" make -j $(nproc) -C "$NXDK_DIR" NXDK_ONLY=1 CFLAGS=-O2 CXXFLAGS=-O2 all cxbe
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure CMake
working-directory: ${{github.workspace}}
env:
CMAKE_BUILD_TYPE: ${{github.event_name == 'release' && 'Release' || 'RelWithDebInfo'}}
run: cmake -S. -Bbuild-xbox -DCMAKE_BUILD_TYPE=${{env.CMAKE_BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=/opt/nxdk/share/toolchain-nxdk.cmake
- name: Build
working-directory: ${{github.workspace}}
shell: bash
run: cmake --build build-xbox -j $(nproc) --target nxdk_xbe
- name: Upload-Package
if: ${{ !env.ACT }}
uses: actions/upload-artifact@v4
with:
name: devilutionx-xbox
path: build-xbox/pkg/
- name: Package Release
if: ${{ github.event_name == 'release' && !env.ACT }}
working-directory: ${{github.workspace}}/build-xbox/pkg
run: zip -r ../../devilutionx-xbox.zip .
- name: Update Release
if: ${{ github.event_name == 'release' && !env.ACT }}
uses: svenstaro/upload-release-action@v2
with:
file: devilutionx-xbox.zip
overwrite: true