From 56a3c33bdec4288a2888ce7109a411a616a26743 Mon Sep 17 00:00:00 2001 From: Thorsten Otto Date: Tue, 30 Apr 2024 11:05:22 +0200 Subject: [PATCH] Add support for mintelf toolchains --- .github/workflows/build.yml | 13 ++++++++----- .scripts/deploy.sh | 19 +++++++++++++++++-- .scripts/install-freemint.sh | 15 +++++++++++++-- .scripts/setup_env.sh | 2 ++ 4 files changed, 40 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4bd6315..55ab353 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,10 @@ jobs: build: runs-on: ubuntu-20.04 strategy: + fail-fast: false matrix: cpu_target: [ "000", "02060", "030", "040", "060", "col" ] + cross_tool: [ "m68k-atari-mint" ] steps: - uses: actions/checkout@v4 - name: Install SSH keys @@ -19,16 +21,17 @@ jobs: env: SSH_ID: ${{ secrets.SSH_ID }} run: ./.scripts/install_ssh_id.sh - - name: Install packages - run: | - SYSROOT_DIR="/" ./.scripts/install-freemint.sh binutils gcc mintbin - ./.scripts/install-freemint.sh mintlib fdlibm gemlib cflib - ./.scripts/install-hcp.sh - name: Setup environment env: PROJECT_VERSION: "2.7" CPU_TARGET: ${{ matrix.cpu_target }} + CROSS_TOOL: ${{ matrix.cross_tool }} run: ./.scripts/setup_env.sh + - name: Install packages + run: | + SYSROOT_DIR="/" ./.scripts/install-freemint.sh binutils gcc mintbin + ./.scripts/install-freemint.sh mintlib fdlibm gemlib cflib + ./.scripts/install-hcp.sh - name: build run: ./.scripts/build.sh - name: deploy diff --git a/.scripts/deploy.sh b/.scripts/deploy.sh index 49c36f7..36b4810 100755 --- a/.scripts/deploy.sh +++ b/.scripts/deploy.sh @@ -1,6 +1,7 @@ #!/bin/sh -x -UPLOAD_DIR=web196@server43.webgo24.de:/home/www/snapshots +SERVER=web196@server43.webgo24.de +UPLOAD_DIR=$SERVER:/home/www/snapshots if [ -z "${DEPLOY_ARCHIVE+x}" ] then @@ -8,6 +9,8 @@ then DEPLOY_ARCHIVE="zip" fi +toolsuffix=${CROSS_TOOL##*-} + if [ -n "${CPU_TARGET+x}" ] then ARCHIVE_NAME="${PROJECT_NAME}-${PROJECT_VERSION}-${SHORT_ID}-${CPU_TARGET}.${DEPLOY_ARCHIVE}" @@ -54,10 +57,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 ${PROJECT_NAME}-${PROJECT_VERSION}-${SHORT_ID} > .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 b9cdcc4..8eb88e3 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}" = "" ]