forked from joncampbell123/dosbox-x
-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (150 loc) · 6.86 KB
/
macos.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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: macOS builds
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
macOS_CI_build:
permissions:
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
contents: write # for actions/checkout to fetch code and softprops/action-gh-release
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: macos-12
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Install libraries
run: |
brew install autoconf automake nasm glfw glew coreutils sevenzip
mkdir -p package/dosbox-x
mkdir -p package/dosbox-x-sdl2
# cd vs/sdlnet && ./build-dosbox.sh
- name: Update build info
run: |
echo "timestamp=`git show -s --format=%at | xargs -I# gdate -d @# +%Y%m%d%H%M%S`" >> $GITHUB_ENV
export shortsha=`echo ${GITHUB_SHA} | cut -c1-7`
export copyrightyear=`git show -s --format=%at | xargs -I# gdate -d @# +'%Y'`
export updatestr=`git show -s --format=%at | xargs -I# gdate -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 macOS SDL1
run: |
top=`pwd`
./build-macos
strip $top/src/dosbox-x
make dosbox-x.app
mv dosbox-x.app $top/package/dosbox-x
- name: Build macOS SDL2
run: |
top=`pwd`
./build-macos-sdl2
strip $top/src/dosbox-x
make dosbox-x.app
mv dosbox-x.app $top/package/dosbox-x-sdl2
- name: Unit testing
run: |
top=`pwd`
chmod +x $top/package/dosbox-x/dosbox-x.app/Contents/MacOS/dosbox-x $top/package/dosbox-x-sdl2/dosbox-x.app/Contents/MacOS/dosbox-x
$top/package/dosbox-x/dosbox-x.app/Contents/MacOS/dosbox-x -tests
$top/package/dosbox-x-sdl2/dosbox-x.app/Contents/MacOS/dosbox-x -tests
- name: Package build
run: |
top=`pwd`
cp $top/CHANGELOG $top/package/dosbox-x/CHANGELOG.txt
cp $top/COPYING $top/package/dosbox-x/COPYING.txt
cp $top/contrib/macos/readme.txt $top/package/dosbox-x/README.txt
cp $top/CHANGELOG $top/package/dosbox-x-sdl2/CHANGELOG.txt
cp $top/COPYING $top/package/dosbox-x-sdl2/COPYING.txt
cp $top/contrib/macos/readme.txt $top/package/dosbox-x-sdl2/README.txt
cd $top/package/
7zz a $top/dosbox-x-macosx-x86_64-${{ env.timestamp }}.zip *
cd $top
- name: Upload preview package
uses: actions/[email protected]
with:
name: dosbox-x-macosx-x86_64-${{ env.timestamp }}
path: ${{ github.workspace }}/dosbox-x-macosx-x86_64-${{ env.timestamp }}.zip
- name: Upload release package
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dosbox-x-macosx-x86_64-${{ env.timestamp }}.zip
macOS_ARM_CI_build:
permissions:
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
contents: write # for actions/checkout to fetch code and softprops/action-gh-release
if: github.event_name == 'push' || github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch'
runs-on: macos-14
steps:
- name: Cancel previous runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v4
- name: Install libraries
run: |
brew install autoconf automake nasm glfw glew coreutils sevenzip
mkdir -p package/dosbox-x
mkdir -p package/dosbox-x-sdl2
# cd vs/sdlnet && ./build-dosbox.sh
- name: Update build info
run: |
echo "timestamp=`git show -s --format=%at | xargs -I# gdate -d @# +%Y%m%d%H%M%S`" >> $GITHUB_ENV
export shortsha=`echo ${GITHUB_SHA} | cut -c1-7`
export copyrightyear=`git show -s --format=%at | xargs -I# gdate -d @# +'%Y'`
export updatestr=`git show -s --format=%at | xargs -I# gdate -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 macOS SDL1
run: |
top=`pwd`
./build-macos
strip $top/src/dosbox-x
make dosbox-x.app
mv dosbox-x.app $top/package/dosbox-x
- name: Build macOS SDL2
run: |
top=`pwd`
./build-macos-sdl2
strip $top/src/dosbox-x
make dosbox-x.app
mv dosbox-x.app $top/package/dosbox-x-sdl2
- name: Unit testing
run: |
top=`pwd`
chmod +x $top/package/dosbox-x/dosbox-x.app/Contents/MacOS/dosbox-x $top/package/dosbox-x-sdl2/dosbox-x.app/Contents/MacOS/dosbox-x
$top/package/dosbox-x/dosbox-x.app/Contents/MacOS/dosbox-x -tests
$top/package/dosbox-x-sdl2/dosbox-x.app/Contents/MacOS/dosbox-x -tests
- name: Package build
run: |
top=`pwd`
cp $top/CHANGELOG $top/package/dosbox-x/CHANGELOG.txt
cp $top/COPYING $top/package/dosbox-x/COPYING.txt
cp $top/contrib/macos/readme.txt $top/package/dosbox-x/README.txt
cp $top/CHANGELOG $top/package/dosbox-x-sdl2/CHANGELOG.txt
cp $top/COPYING $top/package/dosbox-x-sdl2/COPYING.txt
cp $top/contrib/macos/readme.txt $top/package/dosbox-x-sdl2/README.txt
cd $top/package/
7zz a $top/dosbox-x-macosx-arm64-${{ env.timestamp }}.zip *
cd $top
- name: Upload preview package
uses: actions/[email protected]
with:
name: dosbox-x-macosx-arm64-${{ env.timestamp }}
path: ${{ github.workspace }}/dosbox-x-macosx-arm64-${{ env.timestamp }}.zip
- name: Upload release package
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: dosbox-x-macosx-arm64-${{ env.timestamp }}.zip