-
Notifications
You must be signed in to change notification settings - Fork 4
164 lines (138 loc) · 5.47 KB
/
packaging.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
162
163
164
name: Packaging
on:
push:
push:
#tags:
#- "v*"
branches:
- master
jobs:
win_installer:
name: Build Windows installer
runs-on: windows-latest
if: "contains(github.event.head_commit.message, 'prepare_build')"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
# Use 'tools' to install win32_mingw810,
# because MinGw shipped with this docker is not able to compile (link) 32bits Qt project
- name: Install Qt 5.15
uses: jurplel/install-qt-action@v4
with:
version: '5.15.2'
host: 'windows'
target: 'desktop'
arch: 'win32_mingw81'
tools: 'tools_mingw,qt.tools.win32_mingw810'
- name: Variables and Qt 5 environment configuration
shell: pwsh
run: |
Write-Output "${{ env.Qt5_DIR }}/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Write-Output "${{ env.IQTA_TOOLS }}/mingw810_32/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo ("NOOTKA_VERSION=" + $((Get-Content .\src\libs\core\nootkaconfig.h | %{ $_.Split(' ')[2]; }) -replace '"', '')) >> $env:GITHUB_ENV
echo ("NOOTKA_COM_CNT=" + $(git rev-list HEAD --count)) >> $env:GITHUB_ENV
- name: Compile and prepare installer
shell: pwsh
run: |
./packaging/nsis/build_installer.ps1
Move-Item -Path .\build\installs\Nootka-*-Windows-Installer.exe -Destination "Nootka-${{ env.NOOTKA_VERSION }}-b${{ env.NOOTKA_COM_CNT }}-Windows-Installer.exe"
- name: Upload installer to GitHub
uses: actions/upload-artifact@v4
with:
name: "Nootka-${{ env.NOOTKA_VERSION }}-b${{ env.NOOTKA_COM_CNT }}-Windows-Installer.exe"
path: "D:/a/nootka/nootka/Nootka-${{ env.NOOTKA_VERSION }}-b${{ env.NOOTKA_COM_CNT }}-Windows-Installer.exe"
macos_dmg:
name: Build Mac dmg
runs-on: macos-13
needs: win_installer
#if: "contains(github.event.commits[0].message, 'prepare_build')"
steps:
- name: Select Xcode version for Mac
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '14.3'
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set variables
run: |
VER=$(cat src/libs/core/nootkaconfig.h | awk -F" " '{ print $3 }' | sed 's/\"//g')
echo "NOOTKA_VERSION=$VER" >> $GITHUB_ENV
CNT=$(git rev-list HEAD --count)
echo "NOOTKA_COM_CNT=$CNT" >> $GITHUB_ENV
- name: Install Qt
uses: jurplel/install-qt-action@v4
- name: Install fftw, sound-touch, ogg-vorbis
run: |
#brew update
brew install fftw
brew install sound-touch
brew install libogg
brew install libvorbis
#brew upgrade
- name: Compile and prepare dmg
run: |
echo "version is ${{ env.NOOTKA_VERSION }}"
echo "commits number is ${{ env.NOOTKA_COM_CNT }}"
mkdir build
cd ./build
mkdir installs
MACOSX_DEPLOYMENT_TARGET=10.14
export MACOSX_DEPLOYMENT_TARGET
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=./installs ../
make -j 2
make install
make deploy
make dmg
cp installs/Nootka*.dmg ../
cd ..
mv Nootka*.dmg Nootka-${{ env.NOOTKA_VERSION }}-b${{ env.NOOTKA_COM_CNT }}.dmg
- name: Upload dmg to GitHub
uses: actions/upload-artifact@v4
with:
name: Nootka-${{ env.NOOTKA_VERSION }}-b${{ env.NOOTKA_COM_CNT }}.dmg
path: /Users/runner/work/nootka/nootka/Nootka-${{ env.NOOTKA_VERSION }}-b${{ env.NOOTKA_COM_CNT }}.dmg
upload_package:
name: Uploading to SF
runs-on: ubuntu-latest
needs: macos_dmg
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set variables
run: |
VER=$(cat src/libs/core/nootkaconfig.h | awk -F" " '{ print $3 }' | sed 's/\"//g')
echo "NOOTKA_VERSION=$VER" >> $GITHUB_ENV
CNT=$(git rev-list HEAD --count)
echo "NOOTKA_COM_CNT=$CNT" >> $GITHUB_ENV
- name: get bundle
uses: actions/download-artifact@v4
with:
name: Nootka-${{ env.NOOTKA_VERSION }}-b${{ env.NOOTKA_COM_CNT }}.dmg
- name: get installer
uses: actions/download-artifact@v4
with:
name: Nootka-${{ env.NOOTKA_VERSION }}-b${{ env.NOOTKA_COM_CNT }}-Windows-Installer.exe
- name: Upload dmg to SF
uses: burnett01/[email protected]
with:
switches: -avzr --delete
path: Nootka-${{ env.NOOTKA_VERSION }}-b${{ env.NOOTKA_COM_CNT }}.dmg
remote_path: ${{ secrets.REMOTE_PATH }}
remote_host: ${{ secrets.SSH_HOST }}
remote_user: ${{ secrets.SSH_USER }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Upload installer to SF
uses: burnett01/[email protected]
with:
switches: -avzr --delete
path: Nootka-${{ env.NOOTKA_VERSION }}-b${{ env.NOOTKA_COM_CNT }}-Windows-Installer.exe
remote_path: ${{ secrets.REMOTE_PATH }}
remote_host: ${{ secrets.SSH_HOST }}
remote_user: ${{ secrets.SSH_USER }}
remote_key: ${{ secrets.SSH_PRIVATE_KEY }}