Skip to content

Commit

Permalink
Merge branch 'master' into use-alpine-latest
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkwouter authored May 14, 2024
2 parents e4f54ab + df06af9 commit a9fb904
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 71 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,26 @@ jobs:
container: ${{ matrix.os[0] }}:${{ matrix.os[1] }}
strategy:
matrix:
os: [[alpine, latest], [fedora, latest]]
os: [
[alpine, latest],
[fedora, latest],
]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies Alpine
if: matrix.os[0] == 'alpine'
run: |
apk add build-base bash gcc git make autoconf automake python3 py3-pip cmake pkgconfig libarchive-dev openssl-dev gpgme-dev libtool \
flex bison texinfo gmp-dev mpfr-dev mpc1-dev readline-dev ncurses-dev
apk add --no-cache build-base bash gcc git make autoconf automake python3 py3-pip cmake pkgconfig libarchive-dev openssl-dev gpgme-dev \
libtool flex bison texinfo gmp-dev mpfr-dev mpc1-dev readline-dev ncurses-dev
- name: Install dependencies Fedora
if: matrix.os[0] == 'fedora'
run: |
dnf -y install @development-tools gcc gcc-c++ g++ wget git autoconf automake python3 python3-pip make cmake pkgconf \
libarchive-devel openssl-devel gpgme-devel libtool gettext texinfo bison flex gmp-devel mpfr-devel libmpc-devel ncurses-devel \
diffutils glibc-gconv-extra
diffutils glibc-gconv-extra xz
- name: Compile Tools
run: |
Expand All @@ -43,7 +47,7 @@ jobs:
run: |
tar -zcvf pspdev.tar.gz pspdev
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: pspdev-${{ steps.slug.outputs.sha8 }}-${{ matrix.os[0] }}
path: pspdev.tar.gz
Expand All @@ -53,32 +57,28 @@ jobs:
runs-on: ${{ matrix.os[0] }}
strategy:
matrix:
os: [[macos-latest, bash], [ubuntu-latest, bash]]
os: [
[macos-latest, arm64, bash],
[macos-13, x86_64, bash],
[ubuntu-latest, x86_64, bash],
]
fail-fast: false
defaults:
run:
shell: ${{ matrix.os[1] }} {0}
shell: ${{ matrix.os[2] }} {0}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install Dependencies Ubuntu
if: matrix.os[0] == 'ubuntu-latest'
run: |
sudo apt-get -y install libarchive-dev libcurl4 libcurl4-openssl-dev libssl-dev libarchive-dev libgpgme-dev \
gettext texinfo bison flex libncurses5-dev libgmp3-dev libmpfr-dev libmpc-dev
echo "MSYSTEM=x64" >> $GITHUB_ENV
- name: Install Dependencies Mac
if: startsWith( matrix.os[0], 'macos' )
run: |
brew install automake libarchive bash openssl gpgme libtool gettext texinfo bison flex gnu-sed gsl gmp mpfr
echo "MSYSTEM=x64" >> $GITHUB_ENV
- name : Install dependencies on required OS
run: |
./prepare.sh
- name: Compile Tools
run: |
export PATH="/usr/local/opt/libtool/libexec/gnubin:$PATH"
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/libarchive/lib/pkgconfig:/usr/local/opt/openssl@3/lib/pkgconfig"
export PATH="$(brew --prefix gnu-sed)/libexec/gnubin:$PATH" # This really is only needed for macOS
export PATH="$(brew --prefix libtool)/libexec/gnubin:$PATH" # This really is only needed for macOS
export PKG_CONFIG_PATH="$(brew --prefix libarchive)/lib/pkgconfig:$(brew --prefix openssl)/lib/pkgconfig" #This really is only needed for macOS
export PSPDEV=$PWD/pspdev
export PATH=$PATH:$PSPDEV/bin
./toolchain.sh
Expand All @@ -93,5 +93,5 @@ jobs:
- uses: actions/upload-artifact@v3
with:
name: pspdev-${{ steps.slug.outputs.sha8 }}-${{ matrix.os[0] }}
name: pspdev-${{ steps.slug.outputs.sha8 }}-${{ matrix.os[0] }}-${{ matrix.os[1] }}
path: pspdev.tar.gz
25 changes: 4 additions & 21 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,47 +14,30 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Extract DOCKER_TAG using tag name
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "DOCKER_TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Use default DOCKER_TAG
if: startsWith(github.ref, 'refs/tags/') != true
run: |
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Github registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io

- uses: docker/build-push-action@v4
- uses: docker/build-push-action@v5
with:
push: true
tags: ghcr.io/${{ github.repository }}:${{ env.DOCKER_TAG }}
build-args: |
BASE_DOCKER_ALLEGREX_IMAGE=ghcr.io/${{ github.repository_owner }}/psptoolchain-allegrex:${{ env.DOCKER_TAG }}
BASE_DOCKER_EXTRA_IMAGE=ghcr.io/${{ github.repository_owner }}/psptoolchain-extra:${{ env.DOCKER_TAG }}
- name: Send Compile action
run: |
export DISPATCH_ACTION="$(echo run_build)"
echo "NEW_DISPATCH_ACTION=$DISPATCH_ACTION" >> $GITHUB_ENV
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v2
with:
repository: ${{ github.repository_owner }}/pspsdk
token: ${{ secrets.DISPATCH_TOKEN }}
event-type: ${{ env.NEW_DISPATCH_ACTION }}
45 changes: 45 additions & 0 deletions prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

echo "Detecting OS and installing packages required for PSP Toolchain"

#Handle macOS first
if [ "$(uname -s)" = "Darwin" ]; then
## Check if using brew
if command -v brew &> /dev/null; then
brew update
brew install gettext texinfo bison flex gnu-sed ncurses gsl gmp mpfr autoconf automake cmake libusb-compat libarchive gpgme bash openssl libtool
brew reinstall openssl # https://github.com/Homebrew/homebrew-core/issues/169728#issuecomment-2074958306
fi
## Check if using MacPorts
if command -v port &> /dev/null; then
sudo port install autoconf automake cmake doxygen gsed libelf libtool pkgconfig
fi
else

TESTOS=$(cat /etc/os-release | grep -w "ID" | cut -d '=' -f2)

case $TESTOS in

ubuntu | debian)
sudo apt-get update
sudo apt-get -y install texinfo bison flex gettext libgmp3-dev libmpfr-dev libmpc-dev libusb-dev libreadline-dev libcurl4 libcurl4-openssl-dev libssl-dev libarchive-dev libgpgme-dev
;;
rhel | fedora)
dnf -y install @development-tools gcc gcc-c++ g++ wget git autoconf automake python3 python3-pip make cmake pkgconf \
libarchive-devel openssl-devel gpgme-devel libtool gettext texinfo bison flex gmp-devel mpfr-devel libmpc-devel ncurses-devel diffutils \
libusb-compat-0.1-devel readline-devel libcurl-devel which glibc-gconv-extra xz
;;
gentoo)
sudo emerge --noreplace net-misc/wget dev-vcs/git dev-python/pip sys-apps/fakeroot \
app-arch/libarchive app-crypt/gpgme sys-devel/bison sys-devel/flex\
dev-libs/mpc dev-libs/libusb-compat
;;
arch)
sudo pacman -Sy gcc clang make cmake patch git texinfo flex bison gettext wget gsl gmp mpfr libmpc libusb readline libarchive gpgme bash openssl libtool libusb-compat boost python-pip
;;
*)
echo "$TESTOS not supported here"
;;
esac

fi
11 changes: 0 additions & 11 deletions toolchain-local.sh

This file was deleted.

14 changes: 0 additions & 14 deletions toolchain-sudo.sh

This file was deleted.

0 comments on commit a9fb904

Please sign in to comment.