@@ -2,108 +2,176 @@ name: CI
22
33on :
44 push :
5+ paths-ignore :
6+ - ' **.md'
7+ - ' **.rst'
58 pull_request :
9+ paths-ignore :
10+ - ' **.md'
11+ - ' **.rst'
612 repository_dispatch :
713 types : [run_build, run_release]
814 workflow_dispatch : {}
15+ env :
16+ HOMEBREW_NO_ANALYTICS : 1
17+ HOMEBREW_NO_AUTO_UPDATE : 1
18+ HOMEBREW_NO_INSTALL_UPGRADE : 1
19+ HOMEBREW_NO_INSTALL_CLEANUP : 1
20+ DEBIAN_FRONTEND : noninteractive
21+ TZ : Japan
922
1023jobs :
1124 build :
12- runs-on : ${{ matrix.target.machine }}
1325 strategy :
1426 matrix :
15- target :
16- - machine : macos-latest
27+ os :
28+ - runs-on : macos-latest
1729 architecture : arm64
1830 shell : bash
19- packageManager : brew
20- - machine : macos-13
31+ container : null
32+ container-options : " "
33+ macos-package-manager : brew
34+ - runs-on : macos-13
2135 architecture : x86_64
2236 shell : bash
23- packageManager : brew
24- - machine : macos-latest
37+ container : null
38+ container-options : " "
39+ macos-package-manager : brew
40+ - runs-on : macos-latest
2541 architecture : arm64
2642 shell : bash
27- packageManager : macport
28- - machine : ubuntu-latest
43+ container : null
44+ container-options : " "
45+ macos-package-manager : port
46+ - runs-on : ubuntu-latest
2947 architecture : x86_64
3048 shell : bash
31- packageManager : default
32- - machine : ubuntu-22.04-arm
49+ container : " ubuntu:20.04"
50+ container-options : " --user 0"
51+ macos-package-manager : null
52+ - runs-on : ubuntu-24.04-arm
3353 architecture : arm64
3454 shell : bash
35- packageManager : default
36- - machine : ubuntu-24.04-arm
37- architecture : arm64
38- shell : bash
39- packageManager : default
40- - machine : windows-latest
55+ container : " ubuntu:20.04"
56+ container-options : " --user 0"
57+ macos-package-manager : null
58+ - runs-on : windows-latest
4159 architecture : x86_64
4260 shell : msys2
43- packageManager : default
61+ container : null
62+ container-options : " "
63+ macos-package-manager : null
4464 fail-fast : false
65+ runs-on : ${{ matrix.os.runs-on }}
4566 defaults :
4667 run :
47- shell : ${{ matrix.target.shell }} {0}
68+ shell : ${{ matrix.os.shell }} {0}
69+ container :
70+ image : ${{ matrix.os.container }}
71+ options : ${{ matrix.os.container-options }}
72+ timeout-minutes : 240
4873
4974 steps :
50- - uses : actions/checkout@v4
75+ - name : Checkout repository
76+ uses : actions/checkout@v4
5177
5278 - name : Install Ubuntu packages
53- if : startsWith(matrix.target.machine , 'ubuntu')
79+ if : startsWith(matrix.os.runs-on , 'ubuntu')
5480 run : |
55- sudo apt-get update
56- sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev
81+ apt-get -y update
82+ apt-get -y -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold' install texinfo bison flex gettext autopoint autoconf automake libgmp3-dev libmpfr-dev libmpc-dev cmake g++ gcc git libgsl-dev make patch zlib1g-dev wget curl
5783
58- - name : Install macOS packages with brew
59- if : startsWith(matrix.target.machine , 'macos') && matrix.target.packageManager == 'brew'
84+ - name : Install macOS packages ( brew)
85+ if : startsWith(matrix.os.runs-on , 'macos') && matrix.os.macos-package-manager == 'brew'
6086 run : |
6187 brew update
62- brew install texinfo bison flex gnu-sed gsl gmp mpfr libmpc
88+ brew install texinfo bison flex gnu-sed autoconf automake libtool gsl gmp mpfr libmpc md5sha1sum wget curl
6389
64- - name : Install macOS packages with macport
65- if : startsWith(matrix.target.machine , 'macos') && matrix.target.packageManager == 'macport '
90+ - name : Install macOS packages (port)
91+ if : startsWith(matrix.os.runs-on , 'macos') && matrix.os.macos-package-manager == 'port '
6692 run : |
6793 curl -LO https://raw.githubusercontent.com/GiovanniBussi/macports-ci/master/macports-ci
68- source ./macports-ci install --remove-brew --version=2.11.5 --sync=rsync
69- sudo port install gmp mpfr libmpc libiconv bison flex texinfo
94+ . ./macports-ci install --remove-brew --version=2.11.5 --sync=rsync
95+ sudo port install gsl gmp mpfr libmpc libiconv bison flex gsed texinfo autoconf automake libtool md5sha1sum wget curl
7096
7197 - name : Install MSYS2 packages
72- if : startsWith(matrix.target.machine , 'windows')
98+ if : startsWith(matrix.os.runs-on , 'windows')
7399 uses : msys2/setup-msys2@v2
74100 with :
75101 msystem : MINGW32
76102 install : |
77- base-devel git make texinfo flex bison patch binutils mpc-devel tar
78- mingw-w64-i686-readline mingw-w64-i686-gcc
79- mingw-w64-i686-cmake mingw-w64-i686-make mingw-w64-i686-libogg
103+ base-devel git make texinfo flex bison patch binutils mpc-devel tar wget curl
104+ autotools gettext gettext-devel
105+ mingw-w64-i686-readline mingw-w64-i686-gcc mingw-w64-i686-cmake
106+ mingw-w64-i686-make mingw-w64-i686-libogg
80107 update : true
81108
82109 - name : Runs all the stages in the shell
83110 run : |
84- export PS2DEV=$PWD/ps2dev
85- export PATH="$(brew --prefix gnu-sed)/libexec/gnubin:$PATH" # This is just needed for MacOS
86- export PATH=$PATH:$PS2DEV/iop/bin
87- ./toolchain.sh
111+ . ./config/ci-env.sh
112+ if test -f ./build-all.sh; then ./build-all.sh; fi
113+ if test -f ./toolchain.sh; then ./toolchain.sh; fi
88114
89- - name : Print version of executables
115+ - name : Print version of executables (ps2toolchain-iop)
116+ if : github.event.repository.name == 'ps2toolchain-iop'
90117 run : |
91118 export PS2DEV=$PWD/ps2dev
92119 export PATH=$PATH:$PS2DEV/iop/bin
93120 mipsel-none-elf-as --version
94121 mipsel-none-elf-ld --version
95122 mipsel-none-elf-gcc --version
96123
124+ - name : Print version of executables (ps2toolchain-ee)
125+ if : github.event.repository.name == 'ps2toolchain-ee'
126+ run : |
127+ export PS2DEV=$PWD/ps2dev
128+ export PATH=$PATH:$PS2DEV/ee/bin
129+ mips64r5900el-ps2-elf-as --version
130+ mips64r5900el-ps2-elf-ld --version
131+ mips64r5900el-ps2-elf-gcc --version
132+
133+ - name : Print version of executables (ps2toolchain-dvp)
134+ if : github.event.repository.name == 'ps2toolchain-dvp'
135+ run : |
136+ export PS2DEV=$PWD/ps2dev
137+ export PATH=$PATH:$PS2DEV/dvp/bin
138+ dvp-as --version
139+
97140 - name : Get short SHA
98141 id : slug
99- run : |
100- echo "sha8=${MSYSTEM}-sha[$(echo ${GITHUB_SHA} | cut -c1-8)]" >> $GITHUB_OUTPUT
142+ run : printf '%s\n' "sha8=$(printf '%s\n' ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_OUTPUT
101143
102- - name : Prepare ps2dev folder
144+ - name : Compress ps2dev folder
103145 run : |
104- tar -zcvf ps2dev-${{matrix.target.machine}}.tar.gz ps2dev
146+ tar -zcvf ps2dev-${{ matrix.os.runs-on }}.tar.gz ps2dev
147+
148+ - name : Upload artifact
149+ uses : actions/upload-artifact@v4
150+ with :
151+ name : ${{ github.event.repository.name }}-${{ matrix.os.runs-on }}-ps2dev-${{ matrix.os.architecture }}-${{ matrix.os.macos-package-manager }}-${{ steps.slug.outputs.sha8 }}
152+ path : ps2dev-${{ matrix.os.runs-on }}.tar.gz
153+
154+ - name : Extract tag name
155+ if : startsWith(github.ref, 'refs/tags/')
156+ id : tag
157+ run : printf 'VERSION=%s\n' "${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
158+
159+ - name : Create pre-release
160+ if : (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main') && github.event.repository.name == 'ps2dev' && matrix.os.macos-package-manager != 'port'
161+ uses : softprops/action-gh-release@v2
162+ with :
163+ files : ps2dev-${{ matrix.os.runs-on }}.tar.gz
164+ prerelease : true
165+ name : " Development build"
166+ tag_name : latest
167+ env :
168+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
105169
106- - uses : actions/upload-artifact@v4
170+ - name : Release
171+ if : startsWith(github.ref, 'refs/tags/') && github.event.repository.name == 'ps2dev' && matrix.os.macos-package-manager != 'port'
172+ uses : softprops/action-gh-release@v2
107173 with :
108- name : ps2dev-${{matrix.target.machine}}-ps2dev-${{matrix.target.architecture}}-${{matrix.target.packageManager}}-${{ steps.slug.outputs.sha8 }}
109- path : ps2dev-${{matrix.target.machine}}.tar.gz
174+ files : ps2dev-${{ matrix.os.runs-on }}.tar.gz
175+ tag_name : ${{ steps.tag.outputs.VERSION }}
176+ env :
177+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments