-
-
Notifications
You must be signed in to change notification settings - Fork 115
67 lines (59 loc) · 2.48 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
name: Build - MacOS
on: [push, pull_request, workflow_dispatch]
env:
TOOLS_URL: https://github.com/mmatyas/pegasus-frontend/releases/download/alpha1
QT_TARGET: macos-static
QT_VERSION: qt51510
QT_VERSION_PRETTY: "5.15.10"
SDL_VERSION: "2.0.20"
jobs:
macos-static:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
with: {submodules: 'recursive', fetch-depth: 0, fetch-tags: true}
- name: Get Qt
run: |
curl -L "${TOOLS_URL}/${QT_VERSION}_${QT_TARGET}.tar.xz" | sudo tar xJ - -C /usr/local/
curl -L "${TOOLS_URL}/apng_patched_headers.tar.xz" | sudo tar xJf - -C "/usr/local/Qt-${QT_VERSION_PRETTY}/include/"
/usr/local/Qt-${QT_VERSION_PRETTY}/bin/qmake --version
- name: Get SDL2
run: curl -L "${TOOLS_URL}/SDL2-${SDL_VERSION}_macos.tar.xz" | sudo tar xJ - -C /usr/local/
- name: Configure
run: /usr/local/Qt-${QT_VERSION_PRETTY}/bin/qmake .
USE_SDL_GAMEPAD=1
USE_SDL_POWER=1
ENABLE_APNG=1
SDL_LIBS='-L/usr/local/SDL2-${SDL_VERSION}/lib -lSDL2 -lm -liconv -Wl,-framework,ForceFeedback -lobjc -Wl,-framework,CoreVideo -Wl,-framework,Cocoa -Wl,-framework,Carbon -Wl,-framework,IOKit -Wl,-framework,GameController'
SDL_INCLUDES=/usr/local/SDL2-${SDL_VERSION}/include/SDL2
QMAKE_CFLAGS='-Wall -Wextra -pedantic -D_THREAD_SAFE'
QMAKE_CXXFLAGS='-Wall -Wextra -pedantic -D_THREAD_SAFE'
- name: Build
run: make
- name: Test
run: make check
- name: Prepare artifacts
run: |
strip -x src/app/Pegasus.app/Contents/MacOS/pegasus-fe
mkdir staging
cp -r src/app/Pegasus.app staging/
cp README.md staging/
cp LICENSE.md staging/
mkdir deploy
export ZIPNAME="pegasus-fe_$(git describe --always)_${QT_TARGET}.zip"
cd staging
zip -r "../deploy/${ZIPNAME}" ./*
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: macos-static
path: deploy
- name: Deploy
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master'
uses: peaceiris/actions-gh-pages@v3
with:
external_repository: mmatyas/pegasus-deploy-staging
personal_token: ${{ secrets.PEGASUS_GHACTIONS_TOKEN }}
publish_branch: continuous-macos-static
publish_dir: ./deploy
force_orphan: true