@@ -3,42 +3,222 @@ name: Build libraries package
33on : [ push, pull_request, workflow_dispatch ]
44
55jobs :
6- build_ps3libraries :
7- runs-on : ubuntu-22.04
6+ build :
7+ runs-on : ${{ matrix.runner }}
8+ strategy :
9+ fail-fast : false
10+ matrix :
11+ include :
12+ - runner : ubuntu-latest
13+ os : linux
14+
15+ - runner : macos-15-intel
16+ os : macos
17+
18+ - runner : macos-26
19+ os : macos
20+
821 steps :
22+ - name : Checkout
23+ uses : actions/checkout@v6
24+
25+ - name : Set env vars
26+ id : slug
27+ run : |
28+ echo "sha_name=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV
29+ echo "NO_SAVANNAH=1" >> $GITHUB_ENV
30+
31+ - name : Install Linux requirements
32+ if : matrix.os == 'linux'
33+ run : |
34+ sudo apt-get -y install gcc libelf-dev autoconf automake bison flex make texinfo patch wget zlib1g-dev libtool-bin bzip2 pkg-config libssl-dev
35+
36+ - name : Install MacOS requirements
37+ if : matrix.os == 'macos'
38+ shell : bash
39+ env :
40+ HOMEBREW_NO_AUTO_UPDATE : 1
41+ HOMEBREW_NO_INSTALL_CLEANUP : 1
42+ HOMEBREW_NO_ENV_HINTS : 1
43+ run : |
44+ eval "$(brew shellenv)"
45+ brew install autoconf automake openssl libelf ncurses zlib gmp wget pkg-config texinfo
46+
47+ - name : Create build folder
48+ run : |
49+ mkdir build
50+
51+ - name : Cache downloaded archives
52+ uses : actions/cache@v5
53+ with :
54+ path : archives
55+ key : archives-${{ hashFiles('archives/archives.txt') }}
56+
57+ - name : Purge unverifiable archives
58+ run : |
59+ while IFS= read -r line; do
60+ set -- $line
61+ [ "${1:-}" = "-" ] || continue
62+ # 3rd field is URL, 5th field (if "->") is rename
63+ url="$3"
64+ rename=""
65+ [ "${4:-}" = "->" ] && rename="${5:-}"
66+ file="${rename:-$(basename "$url")}"
67+ rm -f "archives/$file"
68+ done < archives/archives.txt
69+
70+ - name : Download PS3DEV Toolchain
71+ env :
72+ GH_TOKEN : ${{ github.token }}
73+ run : |
74+ TOOLCHAIN_URL=$(gh api repos/ps3dev/ps3toolchain/releases \
75+ --jq '
76+ map(select(.prerelease and (.draft | not)))
77+ | sort_by(.published_at)
78+ | reverse
79+ | .[0].assets[]
80+ | select(.name == "ps3dev-${{ matrix.os }}-${{ runner.arch }}.tar.gz")
81+ | .browser_download_url
82+ ')
83+
84+ curl -sL "$TOOLCHAIN_URL" | tar xvz -C ./
85+ echo "PS3DEV=${GITHUB_WORKSPACE}/ps3dev" >> $GITHUB_ENV
86+ echo "PSL1GHT=${GITHUB_WORKSPACE}/ps3dev" >> $GITHUB_ENV
87+ echo "PATH=$PATH:$PWD/ps3dev/bin:$PWD/ps3dev/ppu/bin:$PWD/ps3dev/spu/bin" >> $GITHUB_ENV
88+
89+ - name : Download files
90+ working-directory : ./build
91+ run : ../download.sh
92+
93+ - name : Build Psl1ght
94+ run : ./libraries.sh 000
95+
96+ - name : Build Zlib 1.2.13
97+ run : ./libraries.sh 001
98+
99+ - name : Build Libpng 1.4.4
100+ run : ./libraries.sh 002
101+
102+ - name : Build Jpeg 8b
103+ run : ./libraries.sh 003
104+
105+ - name : Build Freetype 2.4.3
106+ run : ./libraries.sh 004
107+
108+ - name : Build Pixman 0.20.0
109+ run : ./libraries.sh 005
110+
111+ - name : Build Cairo 1.10.0
112+ run : ./libraries.sh 006
113+
114+ - name : Build Libogg 1.3.4
115+ run : ./libraries.sh 007
116+
117+ - name : Build Libvorbis 1.3.5
118+ run : ./libraries.sh 008
119+
120+ - name : Build Libzip 0.9.3
121+ run : ./libraries.sh 009
122+
123+ - name : Build Tiff 3.9.4
124+ run : ./libraries.sh 010
125+
126+ - name : Build Libmikmod 3.1.11
127+ run : ./libraries.sh 011
128+
129+ - name : Build Libxml2 2.7.8
130+ run : ./libraries.sh 012
131+
132+ - name : Build Sdl_psl1ght
133+ run : ./libraries.sh 013
134+
135+ - name : Build Sdl2_psl1ght
136+ run : ./libraries.sh 014
137+
138+ - name : Build Sdl_psl1ght_libs
139+ run : ./libraries.sh 015
140+
141+ - name : Build SDL2_mixer 2.0.4
142+ run : ./libraries.sh 016
143+
144+ - name : Build Polarssl 1.3.9
145+ run : ./libraries.sh 017
146+
147+ - name : Build Libcurl 7.64.1
148+ run : ./libraries.sh 018
149+
150+ - name : Build Libmad 0.15.1b
151+ run : ./libraries.sh 019
152+
153+ - name : Build Flac 1.2.1
154+ run : ./libraries.sh 020
155+
156+ - name : Build Faad2 2.7
157+ run : ./libraries.sh 021
158+
159+ - name : Build Libtheora 1.1.1
160+ run : ./libraries.sh 022
161+
162+ - name : Build NoRSX
163+ run : ./libraries.sh 023
164+
165+ - name : Build Libjson
166+ run : ./libraries.sh 024
167+
168+ - name : Build Debugnet
169+ run : ./libraries.sh 025
170+
171+ - name : Build Ps3soundlib
172+ run : ./libraries.sh 026
173+
174+ - name : Build Tiny3d_libfont
175+ run : ./libraries.sh 027
176+
177+ - name : Build MbedTLS 2.28.10
178+ run : ./libraries.sh 028
179+
180+ - name : Build Libunrar
181+ run : ./libraries.sh 029
182+
183+ - name : Build Libnfs
184+ run : ./libraries.sh 030
185+
186+ - name : Build Libsmb2
187+ run : ./libraries.sh 031
188+
189+ - name : Build Package
190+ run : |
191+ 7z a ps3libraries-${{ matrix.os }}-${{ runner.arch }}.zip $PSL1GHT/portlibs/
192+
193+ - name : Push package artifact
194+ uses : actions/upload-artifact@v7
195+ with :
196+ name : ps3libraries-${{ env.sha_name }}-${{ matrix.os }}-${{ runner.arch }}
197+ path : ps3libraries-${{ matrix.os }}-${{ runner.arch }}.zip
198+ if-no-files-found : error
199+
200+ push_release :
201+ if : |
202+ github.event_name == 'push' &&
203+ github.repository == 'ps3dev/ps3libraries'
204+ needs : build
205+ runs-on : ubuntu-latest
206+ permissions :
207+ contents : write
208+ steps :
209+ - name : Checkout
210+ uses : actions/checkout@v6
211+
212+ - name : Download artifacts
213+ uses : actions/download-artifact@v8
214+ with :
215+ path : artifacts
216+ merge-multiple : true
9217
10- - name : Checkout
11- uses : actions/checkout@v4
12-
13- - name : Set env vars
14- id : slug
15- run : |
16- echo "sha_name=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV
17- sudo apt install python2.7
18- sudo apt-get -y install autoconf automake bison flex make texinfo patch wget zlib1g-dev libtool-bin bzip2 pkg-config
19-
20- # using pre-compiled PS3 toolchain
21- # to do: replace toolchain link
22- - name : Download PSL1GHT Toolchain
23- run : |
24- curl -sL https://github.com/bucanero/ps3toolchain/releases/download/ubuntu-latest-fad3b5fb/ps3dev-ubuntu-latest-2020-08-31.tar.gz | tar xvz -C ./
25- curl -sL https://github.com/ps3dev/PSL1GHT/raw/master/ppu/include/sysutil/sysutil.h -o ps3dev/ppu/include/sysutil/sysutil.h
26- curl -sL https://gist.github.com/bucanero/150ec41325894bbd1b4513ecb9e1cfb6/raw/1814600a1b3c804209c4f71dd6316779e160cb25/utime.h -o ps3dev/ppu/ppu/include/sys/utime.h
27- echo "PS3DEV=${GITHUB_WORKSPACE}/ps3dev" >> $GITHUB_ENV
28- echo "PSL1GHT=${GITHUB_WORKSPACE}/ps3dev" >> $GITHUB_ENV
29-
30- - name : Install libraries
31- run : |
32- sed -i.bak '8d' libraries-sudo.sh
33- ./libraries-sudo.sh
34-
35- - name : Build Package
36- run : |
37- 7z a ps3libraries.zip $PSL1GHT/portlibs/
38-
39- - name : Push package artifact
40- uses : actions/upload-artifact@v4
41- with :
42- name : ps3libraries-build_${{ env.sha_name }}
43- path : ps3libraries.zip
44- if-no-files-found : error
218+ - name : Create Pre-Release
219+ env :
220+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
221+ run : |
222+ TAG="nightly-$(date -u +%Y-%m-%d)"
223+ gh release delete "$TAG" --yes --cleanup-tag || true
224+ gh release create "$TAG" artifacts/*.zip --target ${{ GITHUB.SHA }} -t "$TAG" --prerelease
0 commit comments