-
Notifications
You must be signed in to change notification settings - Fork 192
158 lines (155 loc) · 5.71 KB
/
main.yml
File metadata and controls
158 lines (155 loc) · 5.71 KB
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
name: Build
on:
push:
branches:
- master
pull_request:
# Run every day at 5:40.
schedule:
- cron: '40 5 * * *'
jobs:
build_windows:
name: Build for Windows
runs-on: windows-2022
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Determine version
run: |
$VNAME=$(cat VERSION | sed "s/+dev$/+dev-$(git rev-parse --short HEAD)/")
echo "versionName=$VNAME" >> $env:GITHUB_ENV
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MSYS
update: false
install: >-
autoconf-wrapper
automake-wrapper
git
make
pkgconf
mingw-w64-x86_64-gcc
mingw-w64-x86_64-tools
- name: Install Dependencies
run: |
curl.exe -L --max-time 60 -o fpc-installer.exe "https://sourceforge.net/projects/freepascal/files/Win32/3.2.2/fpc-3.2.2.win32.and.win64.exe/download"
curl.exe -L --max-time 60 -o nsis-3.05-setup.exe "https://sourceforge.net/projects/nsis/files/NSIS%203/3.05/nsis-3.05-setup.exe/download"
Start-Process -FilePath ".\\fpc-installer.exe" -ArgumentList "/TYPE=full /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART" -Wait
./nsis-3.05-setup.exe /S
- name: Download prebuilt DLLs
run: |
python dldlls.py
7z x -y usdx-dlls-x86_64.zip -ogame "*.dll"
env:
ARTIFACT_ACCESS_TOKEN: ${{ secrets.MxeActionsReadAccessToken }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
shell: msys2 {0}
run: |
export PATH="/usr/bin:/mingw64/bin:/c/FPC/3.2.2/bin:/c/FPC/3.2.2/bin/i386-win32:$PATH"
export MAKE="/usr/bin/make"
export FPCCFG="/c/FPC/3.2.2/bin/i386-win32/fpc.cfg"
export FPCDIR="/c/FPC/3.2.2"
export FPCMAKE="/c/FPC/3.2.2/bin/i386-win32/fpcmake"
./autogen.sh
./configure
make
- name: Create installer
run: |
del game\*.debug
xcopy game\*.dll installer\dependencies\dll /y
& 'C:\Program Files (x86)\NSIS\makensis.exe' "installer/UltraStar Deluxe.nsi"
mv installer\dist\UltraStar.Deluxe_*_installer.exe UltraStarDeluxe-windows-installer-${{ env.versionName }}.exe
- name: Upload Installer Artifact
uses: actions/upload-artifact@v6
with:
name: UltraStarDeluxe-windows-installer-${{ env.versionName }}
path: UltraStarDeluxe-windows-installer-${{ env.versionName }}.exe
if-no-files-found: error
- name: Upload Portable Artifact
uses: actions/upload-artifact@v6
with:
name: UltraStarDeluxe-windows-portable-${{ env.versionName }}
path: game
if-no-files-found: error
build_mac:
name: Build for MacOS (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, macos-15-intel]
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Determine version
run: |
VNAME=$(cat VERSION | sed "s/+dev$/+dev-$(git rev-parse --short HEAD)/")
echo "versionName=$VNAME" >> $GITHUB_ENV
- name: Determine Arch
run: |
if [ "${{ matrix.os }}" = "macos-15-intel" ]; then
echo "arch=x86" >> $GITHUB_ENV
else
echo "arch=ARM" >> $GITHUB_ENV
fi
- name: Install Dependencies
run: |
brew install fpc sdl2 sdl2_image automake portaudio lua ffmpeg opencv
- name: Generate Build Scripts
run: ./autogen.sh
- name: Configure Project
run: ./configure --with-opencv-cxx-api
- name: Build
run: make macos-dmg
- name: Rename DMG
run: mv UltraStarDeluxe.dmg UltraStarDeluxe-mac-${{ env.arch }}-${{ env.versionName }}.dmg
- name: Upload Image Artifact
uses: actions/upload-artifact@v6
with:
name: UltraStarDeluxe-mac-${{ env.arch }}-${{ env.versionName }}
path: UltraStarDeluxe-mac-${{ env.arch }}-${{ env.versionName }}.dmg
if-no-files-found: error
build_linux:
name: Build for Linux
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Determine version
run: |
VNAME=$(cat VERSION | sed "s/+dev$/+dev-$(git rev-parse --short HEAD)/")
echo "versionName=$VNAME" >> $GITHUB_ENV
- name: Cache build
uses: actions/cache@v5
with:
key: linux-docker-${{ hashFiles('dists/linux/dl.sh', 'dists/linux/tasks.sh', 'dists/linux/dockerenv.sh', 'dists/linux/Dockerfile.in') }}
path: |
dists/linux/prefix
- name: Start container builder
uses: docker/setup-buildx-action@v4
- name: Generate Dockerfile
run: |
cd dists/linux
./dockerenv.sh --dockerfile > Dockerfile
- name: Build container
uses: docker/build-push-action@v7
with:
context: dists/linux
cache-from: type=gha
cache-to: type=gha,mode=max,ignore-error=true
load: true
tags: usdx/buildenv:latest
- name: Build
run: |
cd dists/linux
sed -i '/docker/s/-it\>//' dockerenv.sh
./dockerenv.sh --use-existing=usdx/buildenv:latest make compress
mv UltraStar*.AppImage ../../UltraStarDeluxe-linux-${{ env.versionName }}.AppImage
- name: Upload Image Artifact
uses: actions/upload-artifact@v6
with:
name: UltraStarDeluxe-linux-${{ env.versionName }}
path: UltraStarDeluxe-linux-${{ env.versionName }}.AppImage
if-no-files-found: error