-
Notifications
You must be signed in to change notification settings - Fork 5
104 lines (93 loc) · 3.38 KB
/
Copy pathbuild.yml
File metadata and controls
104 lines (93 loc) · 3.38 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Xbox
on: [push, pull_request]
jobs:
Xbox:
runs-on: ubuntu-latest
steps:
- name: Install and Setup Dependencies
run: |
sudo apt-get update -y && sudo apt-get install -y python3-pip qemu-utils
pip3 install --upgrade pip
pip3 install pyfatx libqcow-python
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
fetch-tags: true
# Git tags need to be generated before compilation so CI build picks up the latest release
- name: Set release tag name
id: release_tag
run: echo "tag=v$(date +'%Y%m%d-%H%M')" >> "$GITHUB_OUTPUT"
- name: Create Git tag
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git tag "${{ steps.release_tag.outputs.tag }}"
git push origin "${{ steps.release_tag.outputs.tag }}"
- name: Compile program
run: |
docker run --rm \
-v "$(pwd)":/workspace -w /workspace \
ghcr.io/xboxdev/nxdk:latest \
sh -c "apk add --no-cache git && \
git config --global --add safe.directory /workspace && \
mkdir -p build && cd build && \
cmake .. -DCMAKE_TOOLCHAIN_FILE=/usr/src/nxdk/share/toolchain-nxdk.cmake -DCMAKE_BUILD_TYPE=Release && \
cmake --build ."
- name: Generate HDD Image
run: |
mkdir c
cp build/default.xbe c/xboxdash.xbe
python3 scripts/create_hdd_image.py c -o xbox_hdd.img
qemu-img convert -f raw -O qcow2 -c xbox_hdd.img xbox_hdd.qcow2
rm xbox_hdd.img
- name: Prepare artifact
run: |
mkdir -p artifact
cp xbox_hdd.qcow2 artifact/xbox_hdd.qcow2
cp build/xemu-dashboard.iso artifact/xemu-dashboard.iso
cp build/default.xbe artifact/default.xbe
{
echo "==== LICENSE for xemu-dashboard ===="
cat LICENSE
echo
echo "==== LICENSE for ftpd ===="
cat lib/ftpd/LICENSE
echo
echo "==== LICENSE for nanoprintf ===="
cat lib/nanoprintf/LICENSE
echo
echo "==== LICENSE for stb ===="
cat lib/stb/LICENSE
echo
echo "==== LICENSE for xgu ===="
cat lib/xgu/LICENSE
echo
echo "==== LICENSE for RobotoMono-Regular.ttf ===="
cat assets/LICENSE_roboto_mono
echo
echo "==== LICENSE for UbuntuMono-Regular.ttf ===="
cat assets/LICENSE_ubuntu_mono
echo "==== LICENSE for SHA1/RC4 functions ===="
cat lib/crypt/LICENSE
echo "==== LICENSE for json parser ===="
cat lib/json/LICENSE
echo "==== LICENSE for mbedtls ===="
cat lib/mbedtls/LICENSE
} > artifact/LICENSE
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: xemu-dashboard
path: artifact
- name: Create GitHub Release
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.release_tag.outputs.tag }}
name: "Build ${{ steps.release_tag.outputs.tag }}"
files: artifact/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}