88
99jobs :
1010 build :
11- runs-on : ${{ matrix.os }}
11+ runs-on : ${{ matrix.runner }}
1212 strategy :
1313 fail-fast : false
1414 matrix :
15- os : [macos-15-intel, ubuntu-latest, macos-26]
15+ include :
16+ - runner : ubuntu-latest
17+ os : linux
18+
19+ - runner : macos-15-intel
20+ os : macos
21+
22+ - runner : macos-26
23+ os : macos
1624
1725 steps :
18- - uses : actions/checkout@v6
19-
20- - name : Install Ubuntu requirements
21- if : matrix.os == 'ubuntu-latest'
22- run : |
23- sudo apt-get update
24- sudo apt-get -y install autoconf automake bison flex gcc libelf-dev make texinfo libncurses5-dev patch python3 python-is-python3 subversion wget zlib1g-dev libtool-bin python3-dev bzip2 libgmp3-dev pkg-config
25-
26- - name : Install macOS intel requirements
27- if : matrix.os == 'macos-15-intel'
28- shell : arch -x86_64 bash -e {0}
29- env :
30- HOMEBREW_NO_AUTO_UPDATE : 1
31- HOMEBREW_NO_INSTALL_CLEANUP : 1
32- HOMEBREW_NO_ENV_HINTS : 1
33- run : |
34- brew install autoconf automake openssl libelf ncurses zlib gmp wget pkg-config texinfo
35-
36- - name : Install macOS arm64 requirements
37- if : matrix.os == 'macos-26'
38- shell : bash -e {0}
39- env :
40- HOMEBREW_NO_AUTO_UPDATE : 1
41- HOMEBREW_NO_INSTALL_CLEANUP : 1
42- HOMEBREW_NO_ENV_HINTS : 1
43- run : |
44- brew install autoconf automake openssl libelf ncurses zlib gmp wget pkg-config texinfo
45-
46- - name : Runs all the stages in the shell
47- if : matrix.os == 'ubuntu-latest'
48- shell : bash -e {0}
49- env :
50- BUILD_PS3TOOLCHAIN_ONLY : 1
51- run : |
52- mkdir $PWD/ps3dev
53- export PS3DEV=$PWD/ps3dev
54- export PSL1GHT=$PS3DEV
55- export PATH=$PATH:$PS3DEV/bin
56- export PATH=$PATH:$PS3DEV/ppu/bin
57- export PATH=$PATH:$PS3DEV/spu/bin
58- ./toolchain.sh
59-
60- - name : Runs all the stages in the shell
61- if : matrix.os == 'macos-15-intel'
62- shell : arch -x86_64 bash -e {0}
63- env :
64- BUILD_PS3TOOLCHAIN_ONLY : 1
65- run : |
66- mkdir $PWD/ps3dev
67- export PS3DEV=$PWD/ps3dev
68- export PSL1GHT=$PS3DEV
69- export PATH=$PATH:$PS3DEV/bin
70- export PATH=$PATH:$PS3DEV/ppu/bin
71- export PATH=$PATH:$PS3DEV/spu/bin
72- ./toolchain.sh
73-
74- - name : Runs all the stages in the shell
75- if : matrix.os == 'macos-26'
76- shell : bash -e {0}
77- env :
78- BUILD_PS3TOOLCHAIN_ONLY : 1
79- run : |
80- mkdir $PWD/ps3dev
81- export PS3DEV=$PWD/ps3dev
82- export PSL1GHT=$PS3DEV
83- export PATH=$PATH:$PS3DEV/bin
84- export PATH=$PATH:$PS3DEV/ppu/bin
85- export PATH=$PATH:$PS3DEV/spu/bin
86- ./toolchain.sh
87-
88- - name : Get short SHA
89- id : slug
90- run : echo "sha8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> "$GITHUB_OUTPUT"
91-
92- - name : Compress ps3dev folder
93- run : |
94- tar -zcvf ps3dev.tar.gz ps3dev
95-
96- - uses : actions/upload-artifact@v6
97- with :
98- name : ps3dev-${{ steps.slug.outputs.sha8 }}-${{matrix.os}}
99- path : ps3dev.tar.gz
26+ - uses : actions/checkout@v6
27+
28+ - name : Install Linux requirements
29+ if : matrix.os == 'linux'
30+ run : |
31+ sudo apt-get update
32+ sudo apt-get -y install \
33+ autoconf automake bison flex gcc libelf-dev make texinfo \
34+ libncurses5-dev patch python3 python-is-python3 subversion \
35+ wget zlib1g-dev libtool-bin python3-dev bzip2 libgmp3-dev \
36+ pkg-config pv libssl-dev
37+
38+ # ------------------------
39+ # macOS dependencies
40+ # ------------------------
41+ - name : Install macOS requirements
42+ if : matrix.os == 'macos'
43+ shell : bash
44+ env :
45+ HOMEBREW_NO_AUTO_UPDATE : 1
46+ HOMEBREW_NO_INSTALL_CLEANUP : 1
47+ HOMEBREW_NO_ENV_HINTS : 1
48+ run : |
49+ eval "$(brew shellenv)"
50+ brew install \
51+ autoconf automake openssl libelf ncurses zlib gmp wget \
52+ pkg-config texinfo pv
53+
54+ # ------------------------
55+ # GLOBAL ENV SETUP
56+ # ------------------------
57+ - name : Setup environment (PS3DEV + base PATH)
58+ shell : bash
59+ run : |
60+ mkdir -p "$PWD/ps3dev"
61+ mkdir -p "$PWD/build"
62+
63+ echo "BUILD_PS3TOOLCHAIN_ONLY=1" >> $GITHUB_ENV
64+ echo "NO_SAVANNAH=1" >> $GITHUB_ENV
65+ echo "PS3DEV=$PWD/ps3dev" >> $GITHUB_ENV
66+ echo "PSL1GHT=$PWD/ps3dev" >> $GITHUB_ENV
67+ echo "PATH=$PATH:$PWD/ps3dev/bin:$PWD/ps3dev/ppu/bin:$PWD/ps3dev/spu/bin" >> $GITHUB_ENV
68+
69+ - name : Cache downloaded archives
70+ uses : actions/cache@v5
71+ with :
72+ path : archives
73+ key : archives-${{ hashFiles('archives/archives.txt') }}
74+
75+ - name : Purge unverifiable archives
76+ run : |
77+ while IFS= read -r line; do
78+ set -- $line
79+ [ "${1:-}" = "-" ] || continue
80+ # 3rd field is URL, 5th field (if "->") is rename
81+ url="$3"
82+ rename=""
83+ [ "${4:-}" = "->" ] && rename="${5:-}"
84+ file="${rename:-$(basename "$url")}"
85+ rm -f "archives/$file"
86+ done < archives/archives.txt
87+
88+ # ------------------------
89+ # Build steps
90+ # ------------------------
91+ - name : Download files
92+ working-directory : ./build
93+ run : ../download.sh
94+
95+ - name : Build Binutils (PPU)
96+ run : ./toolchain.sh 001
97+
98+ - name : Build GCC + Newlib (PPU)
99+ run : ./toolchain.sh 002
100+
101+ - name : Symlinks (PPU)
102+ run : ./toolchain.sh 004
103+
104+ - name : Build Binutils (SPU)
105+ run : ./toolchain.sh 005
106+
107+ - name : Build GCC + Newlib (SPU)
108+ run : ./toolchain.sh 006
109+
110+ - name : Get short SHA
111+ id : slug
112+ run : echo "sha8=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
113+
114+ - name : Compress ps3dev folder
115+ run : tar -zcvf ps3dev-${{ matrix.os }}-${{ runner.arch }}.tar.gz ps3dev
116+
117+ - uses : actions/upload-artifact@v7
118+ with :
119+ name : ps3dev-${{ steps.slug.outputs.sha8 }}-${{ matrix.os }}-${{ runner.arch }}
120+ path : ps3dev-${{ matrix.os }}-${{ runner.arch }}.tar.gz
121+
122+ push_release :
123+ if : |
124+ github.event_name == 'push' &&
125+ github.repository == 'ps3dev/ps3toolchain'
126+ needs : build
127+ runs-on : ubuntu-latest
128+ permissions :
129+ contents : write
130+ steps :
131+ - name : Checkout
132+ uses : actions/checkout@v6
133+
134+ - name : Download artifacts
135+ uses : actions/download-artifact@v8
136+ with :
137+ path : artifacts
138+ merge-multiple : true
139+
140+ - name : Create Pre-Release
141+ env :
142+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
143+ run : |
144+ TAG="nightly-$(date -u +%Y-%m-%d)"
145+ gh release delete "$TAG" --yes --cleanup-tag || true
146+ gh release create "$TAG" artifacts/*.tar.gz --target ${{ GITHUB.SHA }} -t "$TAG" --prerelease
0 commit comments