-
Notifications
You must be signed in to change notification settings - Fork 55
137 lines (126 loc) · 4.67 KB
/
package.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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: Package
concurrency: sdk-package
on:
push:
branches: [ main ]
paths-ignore:
- 'README.md'
workflow_dispatch:
repository_dispatch:
jobs:
package:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019, macos-latest, ubuntu-20.04]
steps:
- name: Install Ubuntu build dependencies.
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get -y install doxygen graphviz ninja-build mono-complete libsdl2-2.0 gnome-themes-standard libgtk2.0-0 xvfb
MESEN_DIR=$(mktemp -d)
echo "MESEN_DIR=$MESEN_DIR" >> $GITHUB_ENV
cd $MESEN_DIR
curl -Lo mesen.zip https://github.com/NovaSquirrel/Mesen-X/releases/download/1.0.1/Mesen-Linux.2022-05-14.zip
unzip mesen.zip
chmod +x Mesen.exe
echo '#!/bin/sh' > mesen
echo "xvfb-run -a /usr/bin/mono $(pwd)/Mesen.exe \"\$@\"" >> mesen
chmod +x mesen
- name: Install Windows build dependencies.
if: startsWith(matrix.os, 'windows')
run: choco install curl ninja
- name: Install MacOS tools
if: startsWith(matrix.os, 'macos')
run: brew update && brew install ninja
- name: Check out the SDK.
uses: actions/checkout@v2
- name: Copy Mesen settings file.
if: startsWith(matrix.os, 'ubuntu')
run: cp test/mesen_settings.xml ${{ env.MESEN_DIR }}/settings.xml
- name: Fetch the latest Ubuntu llvm-mos release.
if: startsWith(matrix.os, 'ubuntu')
run: |
curl -LO https://github.com/llvm-mos/llvm-mos/releases/download/llvm-mos-linux-main/llvm-mos-linux-main.tar.xz
tar -xvf llvm-mos-linux-main.tar.xz
- name: Fetch the latest Windows llvm-mos release.
if: startsWith(matrix.os, 'windows')
run: |
curl -LO https://github.com/llvm-mos/llvm-mos/releases/download/llvm-mos-windows-main/llvm-mos-windows-main.7z
7z x llvm-mos-windows-main.7z
- name: Fetch the latest Mac llvm-mos release.
if: startsWith(matrix.os, 'macos')
run: |
curl -LO https://github.com/llvm-mos/llvm-mos/releases/download/llvm-mos-darwin-main/llvm-mos-darwin-main.tar.xz
tar -xvf llvm-mos-darwin-main.tar.xz
- name: Build the SDK.
run: |
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/llvm-mos -DMESEN_COMMAND=${{ env.MESEN_DIR }}/mesen -G "Ninja" ..
ninja install
- name: Test the SDK.
if: startsWith(matrix.os, 'ubuntu')
run: |
cd build
CTEST_OUTPUT_ON_FAILURE=1 ninja test
- name: Build the docs.
if: startsWith(matrix.os, 'ubuntu')
run: |
cd build
ninja doxygen
- name: Upload the docs to github pages.
if: startsWith(matrix.os, 'ubuntu')
uses: JamesIves/github-pages-deploy-action@v4
with:
folder: build/mos-platform/html
- name: Archive the Linux SDK.
if: startsWith(matrix.os, 'ubuntu')
run: tar -cJvf llvm-mos-linux.tar.xz llvm-mos
- name: Archive the Windows SDK.
if: startsWith(matrix.os, 'windows')
run: 7z a llvm-mos-windows.7z llvm-mos
- name: Archive the Mac OS SDK.
if: startsWith(matrix.os, 'macos')
run: tar -cJvf llvm-mos-macos.tar.xz llvm-mos
- name: Upload the SDK.
uses: actions/upload-artifact@v2
with:
path: |
llvm-mos-linux.tar.xz
llvm-mos-windows.7z
llvm-mos-macos.tar.xz
prerelease:
runs-on: ubuntu-latest
needs: package
steps:
- name: Download the SDK.
uses: actions/download-artifact@v2
with:
name: artifact
- name: Prerelease the SDK.
uses: softprops/action-gh-release@v1
with:
name: Prerelease SDK
body: Prerelease llvm-mos SDK.
tag_name: prerelease
files: |
llvm-mos-linux.tar.xz
llvm-mos-windows.7z
llvm-mos-macos.tar.xz
prerelease: true
- name: Dispatch Test Suite
uses: llvm-mos/repository-dispatch@v1
with:
token: ${{ secrets.ACTION_TOKEN }}
repository: llvm-mos/llvm-test-suite
event-type: on-sdk-update
client-payload: '{"head_commit": ${{ toJSON(github.event.head_commit) }}}'
- name: Dispatch Smoke Test
uses: llvm-mos/repository-dispatch@v1
with:
token: ${{ secrets.ACTION_TOKEN }}
repository: llvm-mos/smoke-test
event-type: on-sdk-update
client-payload: '{"head_commit": ${{ toJSON(github.event.head_commit) }}}'