forked from joncampbell123/dosbox-x
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (120 loc) · 5.16 KB
/
linux.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
name: Linux builds
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
Linux_CI_build:
permissions:
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
contents: read # for actions/checkout to fetch code
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '14'
- name: Build minimal
run: |
echo "timestamp=`git show -s --format=%at | xargs -I# date -d @# +%Y%m%d%H%M%S`" >> $GITHUB_ENV
./build --disable-freetype --disable-libfluidsynth --disable-mt32 --disable-screenshots
- name: Install libraries
run: |
sudo apt-get update -y
sudo apt-get install -y nasm fluidsynth libfluidsynth-dev libpcap-dev libslirp-dev libsdl-net1.2-dev libsdl2-net-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev
mkdir src/bin
- name: Update build info
shell: bash
run: |
export shortsha=`echo ${GITHUB_SHA} | cut -c1-7`
export copyrightyear=`git show -s --format=%at | xargs -I# date -d @# +'%Y'`
export updatestr=`git show -s --format=%at | xargs -I# date -d @# +'%b %d, %Y %I:%M:%S%P'`
echo '/* auto generated */' > include/build_timestamp.h
echo "#define UPDATED_STR \"${updatestr}\"" >> include/build_timestamp.h
echo "#define GIT_COMMIT_HASH \"${shortsha}\"" >> include/build_timestamp.h
echo "#define COPYRIGHT_END_YEAR \"${copyrightyear}\"" >> include/build_timestamp.h
cat include/build_timestamp.h
- name: Build Linux SDL1
run: |
top=`pwd`
./build-debug
strip -s $top/src/dosbox-x
cp $top/src/dosbox-x $top/src/bin/dosbox-x-sdl1
- name: Build Linux SDL2
run: |
top=`pwd`
./build-debug-sdl2
strip -s $top/src/dosbox-x
cp $top/src/dosbox-x $top/src/bin/dosbox-x-sdl2
- name: Unit testing
run: |
top=`pwd`
chmod +x $top/src/bin/dosbox-x-sdl1 $top/src/bin/dosbox-x-sdl2
$top/src/bin/dosbox-x-sdl1 -tests
$top/src/bin/dosbox-x-sdl2 -tests
- name: Package build
run: |
top=`pwd`
mkdir -p $top/src/bin/drivez
mkdir -p $top/src/bin/glshaders
mkdir -p $top/src/bin/languages
cp $top/CHANGELOG $top/src/bin/CHANGELOG.txt
cp $top/dosbox-x.reference.conf $top/src/bin/dosbox-x.reference.conf
cp $top/dosbox-x.reference.full.conf $top/src/bin/dosbox-x.reference.full.conf
cp $top/contrib/fonts/FREECG98.BMP $top/src/bin/FREECG98.BMP
cp $top/contrib/fonts/wqy_1?pt.bdf $top/src/bin/
cp $top/contrib/fonts/Nouveau_IBM.ttf $top/src/bin/Nouveau_IBM.ttf
cp $top/contrib/fonts/SarasaGothicFixed.ttf $top/src/bin/SarasaGothicFixed.ttf
cp $top/contrib/windows/installer/drivez_readme.txt $top/src/bin/drivez/readme.txt
cp $top/contrib/glshaders/* $top/src/bin/glshaders/
cp $top/contrib/translations/*/*.lng $top/src/bin/languages/
- name: Upload preview package
uses: actions/[email protected]
with:
name: dosbox-x-linux-x86_64-${{ env.timestamp }}
path: ${{ github.workspace }}/src/bin/
Test_cxx11:
permissions:
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
contents: read # for actions/checkout to fetch code
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '14'
- name: Install libraries
run: |
sudo apt-get update -y
sudo apt-get install -y nasm fluidsynth libfluidsynth-dev libpcap-dev libslirp-dev libsdl-net1.2-dev libsdl2-net-dev libglu1-mesa-dev freeglut3-dev mesa-common-dev
mkdir src/bin
- name: Build Linux SDL1
run: |
top=`pwd`
./build-debug --enable-force-cxx11
strip -s $top/src/dosbox-x
cp $top/src/dosbox-x $top/src/bin/dosbox-x-sdl1
- name: Build Linux SDL2
run: |
top=`pwd`
./build-debug-sdl2 --enable-force-cxx11
strip -s $top/src/dosbox-x
cp $top/src/dosbox-x $top/src/bin/dosbox-x-sdl2
- name: Unit testing
run: |
top=`pwd`
chmod +x $top/src/bin/dosbox-x-sdl1 $top/src/bin/dosbox-x-sdl2
$top/src/bin/dosbox-x-sdl1 -tests
$top/src/bin/dosbox-x-sdl2 -tests