-
Notifications
You must be signed in to change notification settings - Fork 93
161 lines (131 loc) · 5.07 KB
/
main.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
152
153
154
155
156
157
158
159
160
161
name: Build Porymap
permissions:
contents: write
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build-qt5-linux:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: '5.14.2'
modules: 'qtwidgets qtqml qtcharts'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Configure
run: qmake porymap.pro
- name: Compile
run: make
build-macos:
runs-on: macos-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Cache Qt
id: cache-qt
uses: actions/cache@v1
with:
path: ../Qt
key: ${{ runner.os }}-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.7.*'
modules: 'qtcharts'
cached: ${{ steps.cache-qt.outputs.cache-hit }}
- name: Configure
run: qmake -config release porymap.pro
- name: Compile
run: make
- name: Create Disk Image
if: startsWith(github.ref, 'refs/tags/')
run: macdeployqt porymap.app -dmg
- name: Prep Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir porymap-macOS-${{ github.ref_name }}
cp porymap.dmg porymap-macOS-${{ github.ref_name }}/porymap.dmg
cp RELEASE-README.txt porymap-macOS-${{ github.ref_name }}/README.txt
- name: Bundle Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: zip -r porymap-macOS-${{ github.ref_name }}.zip porymap-macOS-${{ github.ref_name }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: porymap-macOS-${{ github.ref_name }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-static-windows:
runs-on: windows-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: dsaltares/fetch-gh-release-asset@master
if: steps.cache-static-qt.outputs.cache-hit != 'true'
with:
repo: 'huderlem/porymap'
version: 'tags/qt-static-6.0.1-windows'
file: 'Qt-Static-Windows-mingw-6.0.1.zip'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Unzip Static Qt
if: steps.cache-static-qt.outputs.cache-hit != 'true'
run: powershell.exe -Command "Expand-Archive -Path Qt-Static-Windows-mingw-6.0.1.zip -DestinationPath ../Qt"
- uses: dsaltares/fetch-gh-release-asset@master
with:
repo: 'huderlem/porymap'
version: 'tags/qt-static-6.0.1-windows'
file: 'mingw810_64.zip'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Unzip mingw
run: powershell.exe -Command "Expand-Archive -Path mingw810_64.zip -DestinationPath ../mingw810_64"
- name: Add Qt Static to PATH
run: echo "$env:GITHUB_WORKSPACE/../Qt/6.0.1/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Add static config to .pro file
run: echo "CONFIG += qt static" >> porymap.pro
- name: Add static qmake flags to .pro file
run: echo "QMAKE_LFLAGS += -static-libgcc -static-libstdc++ -static -lwinpthread" >> porymap.pro
- name: Run Qmake
env:
QTDIR: ../Qt/6.0.1
run: qmake.exe -o Makefile porymap.pro -spec win32-g++ "CONFIG+=qtquickcompiler"
- name: Add mingw to PATH
run: echo "$env:GITHUB_WORKSPACE/../mingw810_64/bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Compile
env:
QTDIR: ../Qt/6.0.1
run: mingw32-make.exe -j8
- name: Prep Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: |
mkdir porymap-windows-${{ github.ref_name }}
cp release/porymap.exe porymap-windows-${{ github.ref_name }}/porymap.exe
cp RELEASE-README.txt porymap-windows-${{ github.ref_name }}/README.txt
- name: Bundle Release Directory
if: startsWith(github.ref, 'refs/tags/')
run: powershell.exe -Command "Compress-Archive -Path porymap-windows-${{ github.ref_name }} -DestinationPath porymap-windows-${{ github.ref_name }}.zip"
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: porymap-windows-${{ github.ref_name }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}