-
-
Notifications
You must be signed in to change notification settings - Fork 114
140 lines (136 loc) · 5.63 KB
/
macos-build.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
name: macOS CI
on:
push:
branches:
- main
pull_request:
jobs:
build-openbios:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
set-safe-directory: true
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Update packages
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install -y g++-mipsel-linux-gnu
- name: Build OpenBIOS
run: make -C src/mips/openbios -j2
- name: Upload results for MacOS build job
uses: actions/upload-artifact@v3
with:
name: OpenBIOS
path: src/mips/openbios/openbios.bin
- name: Build tests
run: |
make -C src/mips/openbios -j 2 clean
make -C src/mips/tests -j 2 PCSX_TESTS=true
- name: Upload results for MacOS build job
uses: actions/upload-artifact@v3
with:
name: tests
path: '**/*.ps-exe'
macos-build-and-test:
runs-on: macos-11
needs: build-openbios
steps:
- uses: actions/checkout@v1
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: ./.github/scripts/install-brew-dependencies.sh
- name: Fetch submodules
run: git submodule update --init --recursive
- name: Build PCSX-Redux
run: make -j 2 all pcsx-redux-tests
- name: Download OpenBIOS build
uses: actions/download-artifact@v3
with:
name: OpenBIOS
- name: Download mips tests
uses: actions/download-artifact@v3
with:
name: tests
- name: Bundle
run: ./.github/scripts/create-app.sh
- name: Create BUILD environment
run: echo "BUILD=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Injecting OpenBIOS
run: cp openbios.bin PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources
- name: Packaging
run: |
echo '{' > PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo ' "version": "'`git rev-parse HEAD | cut -c 1-8`'",' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo ' "changeset": "'`git rev-parse HEAD`'",' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo ' "timestamp": '`date '+%s'`',' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo ' "channel": "dev",' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo ' "updateInfo": [' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo ' {' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo ' "channel": "dev",' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo ' "method": "appcenter",' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo ' "updateCatalog": "https://install.appcenter.ms/api/v0.1/apps/grumpycoders/pcsx-redux-macos/distribution_groups/public/public_releases",' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo ' "updateInfoBase": "https://install.appcenter.ms/api/v0.1/apps/grumpycoders/pcsx-redux-macos/distribution_groups/public/releases/"' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo ' }' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo ' ]' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
echo '}' >> PCSX-Redux.app/Contents/Resources/share/pcsx-redux/resources/version.json
- name: Signing Application
run: codesign --force -s - -vvvv PCSX-Redux.app
- name: Adjusting for dmg folder
run: |
mkdir dmgdir
mv PCSX-Redux.app dmgdir
cp dmgdir/PCSX-Redux.app/Contents/Resources/AppIcon.icns .
- name: Creating dmg icon
run: |
sips -i AppIcon.icns
DeRez -only icns AppIcon.icns > icns.rsrc
cp AppIcon.icns dmgdir/.VolumeIcon.icns
SetFile -c icnC dmgdir/.VolumeIcon.icns
SetFile -a C dmgdir
- name: Creating Application link
run: ln -s /Applications dmgdir
- name: Creating dmg file
run: hdiutil create -volname PCSX-Redux-$BUILD -srcfolder dmgdir -ov -format UDZO PCSX-Redux-$BUILD.dmg
- name: Applying icon to dmg file
run: |
Rez -append icns.rsrc -o PCSX-Redux-$BUILD.dmg
SetFile -a C PCSX-Redux-$BUILD.dmg
- name: Removing temporary dmg folder
run: rm -rf dmgdir
- name: Upload DMG
uses: actions/upload-artifact@v2
with:
name: Dmg
path: '**/*.dmg'
publish-app:
runs-on: ubuntu-latest
needs: macos-build-and-test
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v1
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install node
uses: actions/setup-node@v2
with:
node-version: '14'
check-latest: true
- name: Install appcenter
run: npm install -g appcenter-cli
- name: Create BUILD environment
run: echo "BUILD=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- name: Download DMG
uses: actions/download-artifact@v2
with:
name: Dmg
- name: Distribute app
env:
APPCENTER_ACCESS_TOKEN: ${{ secrets.MACOS_APPCENTER_ACCESS_TOKEN }}
run: appcenter distribute release -n 0 -b $BUILD -f PCSX-Redux-$BUILD.dmg -g 'Public' -a grumpycoders/pcsx-redux-macos --disable-telemetry