Skip to content

Commit

Permalink
Fix CI and toolchain build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
spicyjpeg committed Jan 9, 2024
1 parent b266e29 commit 105cc29
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
8 changes: 4 additions & 4 deletions .github/scripts/build_toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ GCC_VERSION="13.2.0"
NUM_JOBS="4"

if [ $# -eq 2 ]; then
TARGET_NAME="$1"
PACKAGE_NAME="$2"
PACKAGE_NAME="$1"
TARGET_NAME="$2"
BUILD_OPTIONS=""
elif [ $# -eq 3 ]; then
TARGET_NAME="$1"
PACKAGE_NAME="$2"
PACKAGE_NAME="$1"
TARGET_NAME="$2"
BUILD_OPTIONS="--build=x86_64-linux-gnu --host=$3"
else
echo "Usage: $0 <package name> <target triplet> [host triplet]"
Expand Down
34 changes: 16 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
uses: actions/cache@v3.3.2
with:
enableCrossOsArchive: true
key: gcc
path: gcc
key: toolchain
path: gcc-mipsel-none-elf-*

- name: Install prerequisites
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
Expand All @@ -35,15 +35,13 @@ jobs:
- name: Build toolchain for Linux
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
cd gcc
../psn00bsdk/.github/scripts/build_toolchain.sh gcc-mipsel-none-elf-linux mipsel-none-elf
echo "${{ github.workspace }}/gcc/gcc-mipsel-none-elf-linux/bin" >>$GITHUB_PATH
psn00bsdk/.github/scripts/build_toolchain.sh gcc-mipsel-none-elf-linux mipsel-none-elf
echo "${{ github.workspace }}/gcc-mipsel-none-elf-linux/bin" >>$GITHUB_PATH
- name: Build toolchain for Windows
if: ${{ steps.cache.outputs.cache-hit != 'true' }}
run: |
cd gcc
../psn00bsdk/.github/scripts/build_toolchain.sh gcc-mipsel-none-elf-windows mipsel-none-elf x86_64-w64-mingw32
psn00bsdk/.github/scripts/build_toolchain.sh gcc-mipsel-none-elf-windows mipsel-none-elf x86_64-w64-mingw32
build-psn00bsdk-windows:
name: Build PSn00bSDK on Windows
Expand All @@ -60,12 +58,12 @@ jobs:
uses: actions/cache@v3.3.2
with:
enableCrossOsArchive: true
key: gcc
path: gcc
key: toolchain
path: gcc-mipsel-none-elf-*

- name: Install prerequisites
run: |
pacman -S --noconfirm mingw-w64-x86_64-ninja
pacman -S --noconfirm zip mingw-w64-x86_64-ninja
- name: Fetch repo contents
uses: actions/checkout@v4
Expand All @@ -75,7 +73,7 @@ jobs:

- name: Build and package PSn00bSDK
run: |
cmake --preset ci -S psn00bsdk -G "Visual Studio 17 2022" -DPSN00BSDK_TC=${{ github.workspace }}\gcc\gcc-mipsel-none-elf-windows
cmake --preset ci -S psn00bsdk -G "Visual Studio 17 2022" -DPSN00BSDK_TC=${{ github.workspace }}\gcc-mipsel-none-elf-windows
cmake --build build
cmake --install build
cd dist
Expand All @@ -97,13 +95,13 @@ jobs:
uses: actions/cache@v3.3.2
with:
enableCrossOsArchive: true
key: gcc
path: gcc
key: toolchain
path: gcc-mipsel-none-elf-*

- name: Install prerequisites
run: |
sudo apt-get update -y
sudo apt-get install -y --no-install-recommends ninja-build
sudo apt-get install -y --no-install-recommends zip ninja-build
- name: Fetch repo contents
uses: actions/checkout@v4
Expand All @@ -113,7 +111,7 @@ jobs:

- name: Build and package PSn00bSDK
run: |
cmake --preset ci -S psn00bsdk -G "Ninja" -DPSN00BSDK_TC=${{ github.workspace }}/gcc/gcc-mipsel-none-elf-linux
cmake --preset ci -S psn00bsdk -G "Ninja" -DPSN00BSDK_TC=${{ github.workspace }}/gcc-mipsel-none-elf-linux
cmake --build build
cmake --install build
cd dist
Expand All @@ -138,8 +136,8 @@ jobs:
uses: actions/cache@v3.3.2
with:
enableCrossOsArchive: true
key: gcc
path: gcc
key: toolchain
path: gcc-mipsel-none-elf-*

- name: Fetch repo contents
if: ${{ github.ref_type == 'tag' }}
Expand All @@ -165,6 +163,6 @@ jobs:
#fail_on_unmatched_files: true
body_path: release.md
files: |
gcc/*.zip
gcc-mipsel-none-elf-*.zip
psn00bsdk-windows/*.zip
psn00bsdk-linux/*.zip

0 comments on commit 105cc29

Please sign in to comment.