From 691af2d90e5c4720d4ddb03289216b5798830a00 Mon Sep 17 00:00:00 2001 From: Thorsten Otto Date: Tue, 30 Apr 2024 10:59:21 +0200 Subject: [PATCH] Add support for mintelf toolchains --- .github/workflows/build.yml | 10 ++++++++-- .scripts/deploy.sh | 19 +++++++++++++++++-- .scripts/install-freemint.sh | 15 +++++++++++++-- .scripts/setup_env.sh | 2 ++ 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 207a3a9..eefddb7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,10 @@ on: jobs: build: runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + cross_tool: [ "m68k-atari-mint", "m68k-atari-mintelf" ] steps: - uses: actions/checkout@v4 - name: Install SSH keys @@ -16,6 +20,10 @@ jobs: env: SSH_ID: ${{ secrets.SSH_ID }} run: ./.scripts/install_ssh_id.sh + - name: Setup environment + env: + CROSS_TOOL: ${{ matrix.cross_tool }} + run: ./.scripts/setup_env.sh - name: Install packages run: | sudo apt-get update @@ -24,8 +32,6 @@ jobs: ./.scripts/install-freemint.sh mintlib fdlibm gemlib ./.scripts/install-hcp.sh ./.scripts/install-aranym.sh - - name: Setup environment - run: ./.scripts/setup_env.sh - name: build run: ./.scripts/build.sh - name: deploy diff --git a/.scripts/deploy.sh b/.scripts/deploy.sh index 2bca2d8..9fc617a 100755 --- a/.scripts/deploy.sh +++ b/.scripts/deploy.sh @@ -1,6 +1,9 @@ #!/bin/sh -x -UPLOAD_DIR=web196@server43.webgo24.de:/home/www/snapshots +SERVER=web196@server43.webgo24.de +UPLOAD_DIR=$SERVER:/home/www/snapshots + +toolsuffix=${CROSS_TOOL##*-} ARCHIVE_PATH="${DEPLOY_DIR}/${ARCHIVE_NAME}" @@ -24,10 +27,22 @@ upload_file() { exit 1 } +link_file() { + local from="$1" + local to="$2" + for i in 1 2 3 + do + ssh -o "StrictHostKeyChecking no" $SERVER -- "cd www/snapshots/${PROJECT_DIR}; ln -sf $from $to" + [ $? = 0 ] && return 0 + sleep 1 + done + exit 1 +} + upload_file "$ARCHIVE_PATH" "${UPLOAD_DIR}/${PROJECT_DIR}/${ARCHIVE_NAME}" if test -z "${CPU_TARGET}" then - upload_file "$ARCHIVE_PATH" "${UPLOAD_DIR}/${PROJECT_DIR}/${PROJECT_DIR}-latest.${DEPLOY_ARCHIVE}" + link_file "$ARCHIVE_NAME" "${PROJECT_DIR}-latest.${DEPLOY_ARCHIVE}" fi echo ${ARCHIVE_NAME} > .latest_version diff --git a/.scripts/install-freemint.sh b/.scripts/install-freemint.sh index 61cfa6c..1e84379 100755 --- a/.scripts/install-freemint.sh +++ b/.scripts/install-freemint.sh @@ -4,11 +4,22 @@ # -x: Display expanded script commands DOWNLOAD_DIR=http://tho-otto.de/snapshots -SYSROOT_DIR=${SYSROOT_DIR:-"/usr/m68k-atari-mint/sys-root/usr"} +SYSROOT_DIR=${SYSROOT_DIR:-"/usr/${CROSS_TOOL}/sys-root"} sudo mkdir -p "${SYSROOT_DIR}" && cd "${SYSROOT_DIR}" +toolsuffix=${CROSS_TOOL##*-} + for package in $* do - wget -q -O - "$DOWNLOAD_DIR/${package}/${package}-latest.tar.bz2" | sudo tar xjf - + # for gcc and binutils, use stable current, not experimental latest build + case $package in + gcc | binutils) + filename=${package}-${toolsuffix}-current.tar.bz2 + ;; + *) + filename=${package}-${toolsuffix}-latest.tar.bz2 + ;; + esac + wget -q -O - "$DOWNLOAD_DIR/${package}/${filename}" | sudo tar xjf - done diff --git a/.scripts/setup_env.sh b/.scripts/setup_env.sh index 617d2ea..64f045e 100755 --- a/.scripts/setup_env.sh +++ b/.scripts/setup_env.sh @@ -23,6 +23,8 @@ BRANCH=$(echo "${GITHUB_REF}" | cut -d '/' -f 3) if test "$CPU_TARGET" != ""; then echo "CPU_TARGET=$CPU_TARGET" >> $GITHUB_ENV fi +CROSS_TOOL=${CROSS_TOOL:-m68k-atari-mint} +echo "CROSS_TOOL=$CROSS_TOOL" >> $GITHUB_ENV # GITHUB_HEAD_REF is only set for pull requests if [ "${GITHUB_HEAD_REF}" = "" ]