From 45d3a83cb9514fbc63f21bbb7e47dee056640a4e Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 31 Dec 2022 01:52:48 +0000 Subject: [PATCH 01/55] test new package creation --- .github/workflows/build-toolchain.yml | 263 ++++++++------ .github/workflows/build-toolchain.yml.bak | 111 ++++++ README.md | 2 - azure-pipelines.yml | 92 ----- build.sh | 39 --- .../build/linux64/build-linux64-toolchain.sh | 289 --------------- scripts/build/win64/build-win64-makefile.sh | 82 ----- scripts/build/win64/build-win64-toolchain.sh | 330 ------------------ scripts/build/win64/make-4.2.1.patch | 11 - 9 files changed, 271 insertions(+), 948 deletions(-) create mode 100644 .github/workflows/build-toolchain.yml.bak delete mode 100644 azure-pipelines.yml delete mode 100644 build.sh delete mode 100644 scripts/build/linux64/build-linux64-toolchain.sh delete mode 100644 scripts/build/win64/build-win64-makefile.sh delete mode 100644 scripts/build/win64/build-win64-toolchain.sh delete mode 100644 scripts/build/win64/make-4.2.1.patch diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 41216f0..6388010 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -1,111 +1,168 @@ -name: CI +# Copyright (c) libdragon 2022 +# See LICENSE file in the project root for full license information. + +# This workflow will build the libdragon N64 GCC toolchain to keep it up-to-date. +name: Build latest libdragon N64 MIPS GCC toolchain on: + # This action will take about 40-70 minutes to run! + # It is designed to only fire if the GCC toolchain build file changes. push: pull_request: - branches: - - '!develop**' # excludes develop* branches (reserved to not duplicate builds that are not on forks) - # repository_dispatch: - # types: [run_build] - + jobs: - build: + build-toolchain: + # targets the oldest ubuntu image available to create valid packages for as many versions possible. + # TODO: move to using a docker container to support older versions. + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + include: [ + { target-platform: Windows-x86_64, host: x86_64-w64-mingw32 }, + { target-platform: Linux-x86_64, host: '' } + ] + + steps: + - name: Install native system build dependencies + run: | + sudo apt-get install libmpfr-dev + sudo apt-get install texinfo + sudo apt-get install libmpc-dev + sudo apt-get install squashfs-tools + # If there are other dependencies, we should add them here and make sure the documentation is updated! + + - name: Install x-compile system build dependencies + if: ${{ matrix.target-platform == 'Windows-x86_64' }} + run: | + sudo apt-get install -y mingw-w64 + # If there are other dependencies, we should add them here and make sure the documentation is updated! + + # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-ruby + - name: Set up Ruby + if: ${{ matrix.target-platform == 'Linux-x86_64' }} + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: '3.1' + + - name: Install Package Creator + if: ${{ matrix.target-platform == 'Linux-x86_64' }} + run: | + echo installing jordansissel/fpm ruby package + gem install fpm + fpm --version + continue-on-error: true + + - name: Checkout Code + uses: actions/checkout@v3 + with: + repository: 'dragonminded/libgragon' + fetch-depth: 1 # we only require the last check-in, unless we want to create a changelog. + + # Cache and restore dependencies instead of downloading them to increase build speed. + # Expires after 7 days. + - uses: actions/cache@v3 + id: cache + with: + path: | + ./tools/**/*.tar.gz + ./tools/**/*.tar.bz2 + key: ${{ runner.os }}-dependency-downloads + + - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} + run: | + # required for newlib (as not the default?!) + export PATH="$PATH:${{ runner.temp }}/n64-brew" + cd ./tools/ + sudo N64_INST=${{ runner.temp }}/n64-brew HOST=${{ matrix.host }} ./build-toolchain.sh + continue-on-error: true + + # https://fpm.readthedocs.io/en/v1.15.0/getting-started.html + - name: Generate toolchain packages for UNIX based OS + if: ${{ matrix.target-platform == 'Linux-x86_64' }} + run: | + echo Generating debian package + fpm \ + -t deb \ + -s dir \ + -p $Package_Name-$Package_Version-$Package_Revision-any.deb \ + --name $Package_Name \ + --license $Package_License \ + --version $Package_Version \ + --architecture all \ + --depends bash \ + --description "$Package_Description" \ + --url "$Package_Url" \ + --maintainer "$Package_Maintainer" \ + ${{ runner.temp }}/n64-brew/=/usr/local/ + + echo Generating rpm package + fpm \ + -t rpm \ + -s dir \ + -p $Package_Name-$Package_Version-$Package_Revision-x86_64.rpm \ + --name $Package_Name \ + --license $Package_License \ + --version $Package_Version \ + --architecture x86_64 \ + --depends nginx \ + --description "$Package_Description" \ + --url "$Package_Url" \ + --maintainer "$Package_Maintainer" \ + ${{ runner.temp }}/n64-brew/=/usr/local/ + continue-on-error: true + env: + Package_Name: n64brew-libdragon-toolchain + Package_Version: 12.2.0 # TODO: should bump in line with GCC version?! + Package_Revision: ${{ github.run_id }} + Package_License: GPL + Package_Description: libdragon GCC toolchain for the N64 + Package_Url: https://n64brew.com + Package_Maintainer: N64 Brew Community + + - name: Publish Windows-x86_64 Build Artifacts + if: ${{ matrix.target-platform == 'Windows-x86_64' }} + uses: actions/upload-artifact@v3 + with: + name: gcc-toolchain-mips64-${{ matrix.target-platform }} + path: | + ${{ runner.temp }}/n64-brew + continue-on-error: true + + - name: Publish Linux-x86_64 Build Artifacts + if: ${{ matrix.target-platform == 'Linux-x86_64' }} + uses: actions/upload-artifact@v3 + with: + name: gcc-toolchain-mips64-${{ matrix.target-platform }} + path: | + ./**/*.deb + ./**/*.rpm + continue-on-error: true + + release: runs-on: ubuntu-latest +# if: github.event_name == 'release' && github.event.action == 'created' + needs: build-toolchain steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # # Depending on Ubuntu version, maybe required for GCC install. - # - name: Add GCC Repository - # run: | - # sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - # sudo apt-get -qq update - - # Some of these packages may already be installed, but update just incase (it doesn't hurt)! - - name: Install Required Packages - run: | - sudo apt-get install -y build-essential software-properties-common - # sudo apt-get install -y gcc-10 - # sudo apt-get install -y g++-10 - sudo apt-get install -y mingw-w64 - # sudo apt-get install -y libgmp-dev bison - sudo apt-get install -y libmpfr-dev libmpc-dev - sudo apt-get install -y byacc texinfo - sudo apt-get install -y zip gzip tar - # sudo apt-gey install -y gcc-9-locales wine wine64 # not actually required, but suggested by the CI - - # # Generate a changelog (not currently that helpful (and not required for local builds)). - # - name: Create Changelog - # run: | - # touch "CHANGELOG.txt" - # git log --oneline --decorate > CHANGELOG.txt - - # We do it first to fail fast (as most unknown)! - # Build MakeFile against linux (for windows) - - name: Build win64 makefile executable - run: | - cd $GITHUB_WORKSPACE/scripts/build/win64 - bash ./build-win64-makefile.sh - rm ./build-win64-makefile.sh - - # Build the mips64 GCC toolchain against linux - - name: Build linux64 toolchain - run: | - cd $GITHUB_WORKSPACE/scripts/build/linux64 - bash ./build-linux64-toolchain.sh - rm ./build-linux64-toolchain.sh - - # Compress and move the linux folder ready for upload (not needed for local builds). - - name: Compress and move linux artifact to $GITHUB_WORKSPACE/linux64 - if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') - run: | - mkdir -p $GITHUB_WORKSPACE/linux64/ - cd $GITHUB_WORKSPACE/scripts/build/linux64 - tar -czf ../gcc-toolchain-mips64-linux64.tar.gz * - mv "$GITHUB_WORKSPACE/scripts/build/gcc-toolchain-mips64-linux64.tar.gz" "$GITHUB_WORKSPACE/linux64/" - - # # Publish the compressed linux folder to the to github Artifacts (not needed unless debugging (adds considerable time)). - # - name: Publish linux Build Artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: gcc-toolchain-mips64-linux64 - # path: ${{ github.workspace }}/scripts/build/linux64/* - # retention-days: 5 - - # Build the GCC toolchain against linux (for windows) and compress it (local builds could run build.sh). - - name: Build win64 toolchain - run: | - cd $GITHUB_WORKSPACE/scripts/build/win64 - bash ./build-win64-toolchain.sh - rm ./build-win64-toolchain.sh - - # Compress and move the windows folder ready for upload (not needed for local builds). - - name: Compress and move windows artifacts to $GITHUB_WORKSPACE/win64 - if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') - run: | - mkdir -p $GITHUB_WORKSPACE/win64/ - cd $GITHUB_WORKSPACE/scripts/build/win64 - zip -r -q $GITHUB_WORKSPACE/scripts/build/gcc-toolchain-mips64-win64.zip * - mv "$GITHUB_WORKSPACE/scripts/build/gcc-toolchain-mips64-win64.zip" "$GITHUB_WORKSPACE/win64/" - - # Publish windows build artifacts to github Artifacts (not needed for local builds). - - name: Publish windows Build Artifacts - uses: actions/upload-artifact@v3 - with: - name: gcc-toolchain-mips64-win64 - path: ${{ github.workspace }}/scripts/build/win64/* - - - name: Generate Draft Release - if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 - with: - draft: true - prerelease: true - name: "Vx.x.x-y" - #tag_name: "latest" - files: | - linux64/gcc-toolchain-mips64-linux64.tar.gz - win64/gcc-toolchain-mips64-win64.zip - # CHANGELOG.txt + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: toolchain-files + + - name: Display structure of downloaded files + run: ls -R + + - name: Generate Draft Release +# if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + draft: true + prerelease: true + name: "Vx.x.x-y" + #tag_name: "latest" + files: | + ./**/*.deb + ./**/*.rpm + ./**/*.zip diff --git a/.github/workflows/build-toolchain.yml.bak b/.github/workflows/build-toolchain.yml.bak new file mode 100644 index 0000000..41216f0 --- /dev/null +++ b/.github/workflows/build-toolchain.yml.bak @@ -0,0 +1,111 @@ +name: CI + +on: + push: + pull_request: + branches: + - '!develop**' # excludes develop* branches (reserved to not duplicate builds that are not on forks) + # repository_dispatch: + # types: [run_build] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + # # Depending on Ubuntu version, maybe required for GCC install. + # - name: Add GCC Repository + # run: | + # sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + # sudo apt-get -qq update + + # Some of these packages may already be installed, but update just incase (it doesn't hurt)! + - name: Install Required Packages + run: | + sudo apt-get install -y build-essential software-properties-common + # sudo apt-get install -y gcc-10 + # sudo apt-get install -y g++-10 + sudo apt-get install -y mingw-w64 + # sudo apt-get install -y libgmp-dev bison + sudo apt-get install -y libmpfr-dev libmpc-dev + sudo apt-get install -y byacc texinfo + sudo apt-get install -y zip gzip tar + # sudo apt-gey install -y gcc-9-locales wine wine64 # not actually required, but suggested by the CI + + # # Generate a changelog (not currently that helpful (and not required for local builds)). + # - name: Create Changelog + # run: | + # touch "CHANGELOG.txt" + # git log --oneline --decorate > CHANGELOG.txt + + # We do it first to fail fast (as most unknown)! + # Build MakeFile against linux (for windows) + - name: Build win64 makefile executable + run: | + cd $GITHUB_WORKSPACE/scripts/build/win64 + bash ./build-win64-makefile.sh + rm ./build-win64-makefile.sh + + # Build the mips64 GCC toolchain against linux + - name: Build linux64 toolchain + run: | + cd $GITHUB_WORKSPACE/scripts/build/linux64 + bash ./build-linux64-toolchain.sh + rm ./build-linux64-toolchain.sh + + # Compress and move the linux folder ready for upload (not needed for local builds). + - name: Compress and move linux artifact to $GITHUB_WORKSPACE/linux64 + if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') + run: | + mkdir -p $GITHUB_WORKSPACE/linux64/ + cd $GITHUB_WORKSPACE/scripts/build/linux64 + tar -czf ../gcc-toolchain-mips64-linux64.tar.gz * + mv "$GITHUB_WORKSPACE/scripts/build/gcc-toolchain-mips64-linux64.tar.gz" "$GITHUB_WORKSPACE/linux64/" + + # # Publish the compressed linux folder to the to github Artifacts (not needed unless debugging (adds considerable time)). + # - name: Publish linux Build Artifacts + # uses: actions/upload-artifact@v3 + # with: + # name: gcc-toolchain-mips64-linux64 + # path: ${{ github.workspace }}/scripts/build/linux64/* + # retention-days: 5 + + # Build the GCC toolchain against linux (for windows) and compress it (local builds could run build.sh). + - name: Build win64 toolchain + run: | + cd $GITHUB_WORKSPACE/scripts/build/win64 + bash ./build-win64-toolchain.sh + rm ./build-win64-toolchain.sh + + # Compress and move the windows folder ready for upload (not needed for local builds). + - name: Compress and move windows artifacts to $GITHUB_WORKSPACE/win64 + if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') + run: | + mkdir -p $GITHUB_WORKSPACE/win64/ + cd $GITHUB_WORKSPACE/scripts/build/win64 + zip -r -q $GITHUB_WORKSPACE/scripts/build/gcc-toolchain-mips64-win64.zip * + mv "$GITHUB_WORKSPACE/scripts/build/gcc-toolchain-mips64-win64.zip" "$GITHUB_WORKSPACE/win64/" + + # Publish windows build artifacts to github Artifacts (not needed for local builds). + - name: Publish windows Build Artifacts + uses: actions/upload-artifact@v3 + with: + name: gcc-toolchain-mips64-win64 + path: ${{ github.workspace }}/scripts/build/win64/* + + - name: Generate Draft Release + if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + draft: true + prerelease: true + name: "Vx.x.x-y" + #tag_name: "latest" + files: | + linux64/gcc-toolchain-mips64-linux64.tar.gz + win64/gcc-toolchain-mips64-win64.zip + # CHANGELOG.txt diff --git a/README.md b/README.md index 78965e5..7f49fb8 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,6 @@ sudo N64_INST=/usr/local/n64/ HOST=x86_64-w64-mingw32 ./build-toolchain.sh This repo automatically generates the MIPS64 GCC toolchain to allow cross compilation for the N64. The binaries can be downloaded and used as part of other build scripts/components which saves time (at least 30 minutes) when setting up a developer environment in order to build N64 libraries such as libdragon in a `Windows` environment. -[![Azure Pipeline CI](https://dev.azure.com/n64-tools/N64-Tools/_apis/build/status/N64-tools.mips64-gcc-toolchain)](https://dev.azure.com/n64-tools/N64-Tools/_build/latest?definitionId=1) - [![Github Action CI](https://github.com/n64-tools/mips64-gcc-toolchain/actions/workflows/build-toolchain.yml/badge.svg)](https://github.com/n64-tools/mips64-gcc-toolchain/actions/workflows/build-toolchain.yml) Architecture | Download Links diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 583e31a..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,92 +0,0 @@ -trigger: - branches: - include: - - master - - develop* - - release* - - refs/tags/* - -pr: - autoCancel: true - -pool: - vmImage: 'ubuntu-latest' - -steps: - -# Some of these packages may already be installed, but update just incase (it doesn't hurt)! -- script: | - sudo apt-get install -y build-essential software-properties-common - # sudo apt-get install -y gcc-10 - # sudo apt-get install -y g++-10 - sudo apt-get install -y mingw-w64 - # sudo apt-get install -y libgmp-dev bison - sudo apt-get install -y libmpfr-dev libmpc-dev - sudo apt-get install -y byacc texinfo - sudo apt-get install -y zip gzip tar - displayName: 'Install Required Packages' - continueOnError: false - - # We do it first to fail fast (as most unknown)! - # Build MakeFile against linux (for windows) -- script: | - cd $BUILD_SOURCESDIRECTORY/scripts/build/win64 - bash ./build-win64-makefile.sh - rm ./build-win64-makefile.sh - displayName: 'Build win64 makefile executable' - continueOnError: false - -# Build the mips64 GCC toolchain against linux and compress it ready for upload (local builds could run build.sh). -- script: | - cd $BUILD_SOURCESDIRECTORY/scripts/build/linux64 - bash ./build-linux64-toolchain.sh - rm ./build-linux64-toolchain.sh - tar -czf ../gcc-toolchain-mips64-linux64.tar.gz * - displayName: 'Build linux64 Project' - continueOnError: false - -# Move the compressed linux folder ready for upload (not needed for local builds). -- bash: | - mkdir -p $BUILD_ARTIFACTSTAGINGDIRECTORY/linux64/ - mv "$BUILD_SOURCESDIRECTORY/scripts/build/gcc-toolchain-mips64-linux64.tar.gz" "$BUILD_ARTIFACTSTAGINGDIRECTORY/linux64/" - displayName: 'Move linux Artifacts to Staging Directory' - continueOnError: false - -# # Publish the compressed linux folder to the to Azure Artifacts/TFS or a file share (not needed for local builds). -# - task: PublishBuildArtifacts@1 -# displayName: Publish linux Build Artifacts -# inputs: -# pathtoPublish: '$(Build.ArtifactStagingDirectory)/linux64/' -# artifactName: 'binaries/linux64' -# publishLocation: 'Container' # Options: container, filePath -# #targetPath: # Required when publishLocation == FilePath -# parallel: true # Optional -# #parallelCount: # Optional - - -# Build the GCC toolchain against linux (for windows) and compress it (local builds could run build.sh). -- script: | - cd $BUILD_SOURCESDIRECTORY/scripts/build/win64 - bash ./build-win64-toolchain.sh - rm ./build-win64-toolchain.sh - zip -r -q $BUILD_SOURCESDIRECTORY/scripts/build/gcc-toolchain-mips64-win64.zip * - displayName: 'Build win64 Project' - continueOnError: false - -# Move the compressed windows folder ready for upload (not needed for local builds). -- bash: | - mkdir -p $BUILD_ARTIFACTSTAGINGDIRECTORY/win64/ - mv "$BUILD_SOURCESDIRECTORY/scripts/build/gcc-toolchain-mips64-win64.zip" "$BUILD_ARTIFACTSTAGINGDIRECTORY/win64/" - displayName: 'Move windows Artifacts to Staging Directory' - continueOnError: false - -# Publish windows build artifacts to Azure Artifacts/TFS or a file share (not needed for local builds). -- task: PublishBuildArtifacts@1 - displayName: Publish windows Build Artifacts - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)/win64/' - artifactName: 'binaries/win64' - publishLocation: 'Container' # Options: container, filePath - #targetPath: # Required when publishLocation == FilePath - parallel: true # Optional - #parallelCount: # Optional diff --git a/build.sh b/build.sh deleted file mode 100644 index 28f140e..0000000 --- a/build.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -# Abort on Error -set -e - -export WORKDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# Put build scripts here: -LINUX_BUILD_DIR="${WORKDIR}/scripts/build/linux64" -WIN_BUILD_DIR="${WORKDIR}/scripts/build/win64" - -echo "Starting the linux build process..." -cd ${LINUX_BUILD_DIR} -bash ./build-linux64-toolchain.sh - -rm -rf ./tarballs -rm -rf ./*-source -rm -rf ./*-build -rm -rf ./stamps -rm ./build-linux64-toolchain.sh - -echo "Starting the Windows build process..." -export PATH="${PATH}:${LINUX_BUILD_DIR}/bin" -cd ${WIN_BUILD_DIR} -bash ./build-win64-toolchain.sh - -rm -rf ./tarballs -rm -rf ./*-source -rm -rf ./*-build -rm -rf ./stamps -rm -rf ./x86_64-w64-mingw32 -rm ./build-win64-toolchain.sh - -echo "Compressing files for upload..." -cd ${WORKDIR}/scripts/build/linux64 -tar -czf ../gcc-toolchain-mips64-linux64.tar.gz * -cd ${WORKDIR}/scripts/build/win64 -zip -rq ../gcc-toolchain-mips64-win64.zip * - -echo "The build completed successfully." diff --git a/scripts/build/linux64/build-linux64-toolchain.sh b/scripts/build/linux64/build-linux64-toolchain.sh deleted file mode 100644 index 823277b..0000000 --- a/scripts/build/linux64/build-linux64-toolchain.sh +++ /dev/null @@ -1,289 +0,0 @@ -#!/bin/bash -set -eu - -# -# N64 linux GCC/BINUTILS/NEWLIB/GDB toolchain build script. -# -# Attributions: -# Tyler J. Stachecki -# Robin Jones (NetworkFusion/JonesAlmighty) -# -# This script builds library source covered under the 'GNU LESSER GENERAL PUBLIC LICENSE' -# However, the original source is not changed. -# The repo 'LICENSE' is added for assurance. -# - -# Parallel GCC build jobs -NUM_CPU_THREADS=`grep -c '^processor' /proc/cpuinfo` #$(nproc) -BUILD_NUM_JOBS="--jobs=$NUM_CPU_THREADS --load-average=$NUM_CPU_THREADS" - -BINUTILS="https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" -GCC="https://ftp.gnu.org/gnu/gcc/gcc-11.3.0/gcc-11.3.0.tar.gz" -NEWLIB="https://sourceware.org/pub/newlib/newlib-4.1.0.tar.gz" -GDB="https://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.gz" # fails to x compile on 11.2. requires investigation! - -BUILD=${BUILD:-x86_64-linux-gnu} -HOST=${HOST:-x86_64-linux-gnu} - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd ${SCRIPT_DIR} && mkdir -p {stamps,tarballs} - -export PATH="${PATH}:${SCRIPT_DIR}/bin" - -if [ ! -f stamps/binutils-download ]; then - wget "${BINUTILS}" -O "tarballs/$(basename ${BINUTILS})" - touch stamps/binutils-download -fi - -if [ ! -f stamps/binutils-extract ]; then - mkdir -p binutils-{build,source} - tar -xf tarballs/$(basename ${BINUTILS}) -C binutils-source --strip 1 - touch stamps/binutils-extract -fi - -if [ ! -f stamps/binutils-configure ]; then - pushd binutils-build - ../binutils-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-cpu=mips64vr4300 \ - --with-lib-path="${SCRIPT_DIR}/lib" \ - --enable-64-bit-bfd \ - --enable-plugins \ - --enable-shared \ - --disable-gold \ - --disable-multilib \ - --disable-nls \ - --disable-rpath \ - --disable-static \ - --disable-werror - popd - - touch stamps/binutils-configure -fi - -if [ ! -f stamps/binutils-build ]; then - pushd binutils-build - make $BUILD_NUM_JOBS - popd - - touch stamps/binutils-build -fi - -if [ ! -f stamps/binutils-install ]; then - pushd binutils-build - make install-strip - popd - - touch stamps/binutils-install -fi - -if [ ! -f stamps/gcc-download ]; then - wget "${GCC}" -O "tarballs/$(basename ${GCC})" - touch stamps/gcc-download -fi - -if [ ! -f stamps/gcc-extract ]; then - mkdir -p gcc-{build,source} - tar -xf tarballs/$(basename ${GCC}) -C gcc-source --strip 1 - touch stamps/gcc-extract -fi - -if [ ! -f stamps/gcc-configure ]; then - pushd gcc-build - ../gcc-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-arch=vr4300 \ - --with-tune=vr4300 \ - --enable-languages=c,c++ --without-headers --with-newlib \ - --with-gnu-as=${SCRIPT_DIR}/bin/mips64-elf-as \ - --with-gnu-ld=${SCRIPT_DIR}/bin/mips64-elf-ld \ - --enable-checking=release \ - --enable-shared \ - --enable-shared-libgcc \ - --disable-decimal-float \ - --disable-gold \ - --disable-libatomic \ - --disable-libgomp \ - --disable-libitm \ - --disable-libquadmath \ - --disable-libquadmath-support \ - --disable-libsanitizer \ - --disable-libssp \ - --disable-libunwind-exceptions \ - --disable-libvtv \ - --disable-multilib \ - --disable-nls \ - --disable-rpath \ - --disable-static \ - --disable-threads \ - --disable-win32-registry \ - --enable-lto \ - --enable-plugin \ - --enable-static \ - --without-included-gettext - popd - - touch stamps/gcc-configure -fi - -if [ ! -f stamps/gcc-build ]; then - pushd gcc-build - make $BUILD_NUM_JOBS all-gcc - popd - - touch stamps/gcc-build -fi - -if [ ! -f stamps/gcc-install ]; then - pushd gcc-build - make install-strip-gcc - popd - - # build-win32-toolchain.sh needs this; the cross-compiler build - # will look for mips64-elf-cc and we only have mips64-elf-gcc. - pushd "${SCRIPT_DIR}/bin" - ln -sfv mips64-elf-{gcc,cc} - popd - - touch stamps/gcc-install -fi - -if [ ! -f stamps/libgcc-build ]; then - pushd gcc-build - make $BUILD_NUM_JOBS all-target-libgcc - popd - - touch stamps/libgcc-build -fi - -if [ ! -f stamps/libgcc-install ]; then - pushd gcc-build - make install-target-libgcc - popd - - touch stamps/libgcc-install -fi - -if [ ! -f stamps/newlib-download ]; then - wget "${NEWLIB}" -O "tarballs/$(basename ${NEWLIB})" - touch stamps/newlib-download -fi - -if [ ! -f stamps/newlib-extract ]; then - mkdir -p newlib-{build,source} - tar -xf tarballs/$(basename ${NEWLIB}) -C newlib-source --strip 1 - touch stamps/newlib-extract -fi - -if [ ! -f stamps/newlib-configure ]; then - pushd newlib-build - CFLAGS="-O2 -DHAVE_ASSERT_FUNC -fomit-frame-pointer -ffast-math -fstrict-aliasing" \ - ../newlib-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-cpu=mips64vr4300 \ - --disable-bootstrap \ - --disable-build-poststage1-with-cxx \ - --disable-build-with-cxx \ - --disable-cloog-version-check \ - --disable-dependency-tracking \ - --disable-libada \ - --disable-libquadmath \ - --disable-libquadmath-support \ - --disable-maintainer-mode \ - --disable-malloc-debugging \ - --disable-multilib \ - --disable-newlib-atexit-alloc \ - --disable-newlib-hw-fp \ - --disable-newlib-iconv \ - --disable-newlib-io-float \ - --disable-newlib-io-long-double \ - --disable-newlib-io-long-long \ - --disable-newlib-mb \ - --disable-newlib-multithread \ - --disable-newlib-register-fini \ - --disable-newlib-supplied-syscalls \ - --disable-objc-gc \ - --enable-newlib-io-c99-formats \ - --enable-newlib-io-pos-args \ - --enable-newlib-reent-small \ - --with-endian=little \ - --without-cloog \ - --without-gmp \ - --without-mpc \ - --without-mpfr \ - --disable-libssp \ - --disable-threads \ - --disable-werror - popd - - touch stamps/newlib-configure -fi - -if [ ! -f stamps/newlib-build ]; then - pushd newlib-build - make $BUILD_NUM_JOBS - popd - - touch stamps/newlib-build -fi - -if [ ! -f stamps/newlib-install ]; then - pushd newlib-build - make install - popd - - touch stamps/newlib-install -fi - -if [ ! -f stamps/gdb-download ]; then - wget "${GDB}" -O "tarballs/$(basename ${GDB})" - touch stamps/gdb-download -fi - -if [ ! -f stamps/gdb-extract ]; then - mkdir -p gdb-{build,source} - tar -xf tarballs/$(basename ${GDB}) -C gdb-source --strip 1 - touch stamps/gdb-extract -fi - -if [ ! -f stamps/gdb-configure ]; then - pushd gdb-build - CFLAGS="" LDFLAGS="" \ - ../gdb-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-arch=vr4300 \ - --disable-werror - popd - - touch stamps/gdb-configure -fi - -if [ ! -f stamps/gdb-build ]; then - pushd gdb-build - make $BUILD_NUM_JOBS - popd - - touch stamps/gdb-build -fi - -if [ ! -f stamps/gdb-install ]; then - pushd gdb-build - make install - popd - - touch stamps/gdb-install -fi - -rm -rf "${SCRIPT_DIR}"/tarballs -rm -rf "${SCRIPT_DIR}"/*-source -rm -rf "${SCRIPT_DIR}"/*-build -rm -rf "${SCRIPT_DIR}"/stamps -exit 0 diff --git a/scripts/build/win64/build-win64-makefile.sh b/scripts/build/win64/build-win64-makefile.sh deleted file mode 100644 index badb29f..0000000 --- a/scripts/build/win64/build-win64-makefile.sh +++ /dev/null @@ -1,82 +0,0 @@ -#!/bin/bash -set -eu - -# -# MakeFile (for windows) build script. -# -# Attributions: -# Robin Jones (NetworkFusion/JonesAlmighty) -# -# This script builds library source covered under the 'GNU LESSER GENERAL PUBLIC LICENSE' -# However, the original source is not changed and an OSS patch file is used. -# The repo 'LICENSE' is added for assurance. -# - -# Parallel GCC build jobs -NUM_CPU_THREADS=`grep -c '^processor' /proc/cpuinfo` #$(nproc) -BUILD_NUM_JOBS="--jobs=$NUM_CPU_THREADS --load-average=$NUM_CPU_THREADS" - -MAKE="https://ftp.gnu.org/gnu/make/make-4.2.1.tar.gz" # patches for 4.3 could be provided from https://github.com/mbuilov/gnumake-windows however, there are currently issues with canadian cross! - -BUILD=${BUILD:-x86_64-linux-gnu} -HOST=${HOST:-x86_64-w64-mingw32} - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd ${SCRIPT_DIR} && mkdir -p {stamps,tarballs} - -export PATH="${PATH}:${SCRIPT_DIR}/bin:${SCRIPT_DIR}/../linux64/bin" - -if [ ! -f stamps/make-download ]; then - wget "${MAKE}" -O "tarballs/$(basename ${MAKE})" - touch stamps/make-download -fi - -if [ ! -f stamps/make-extract ]; then - mkdir -p make-{build,source} - tar -xf tarballs/$(basename ${MAKE}) -C make-source --strip 1 - touch stamps/make-extract -fi - -if [ ! -f stamps/make-patch ]; then - pushd make-source - patch -p1 -i ../make-*.patch - popd - touch stamps/make-patch -fi - -if [ ! -f stamps/make-configure ]; then - pushd make-build - ../make-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --disable-largefile \ - --disable-nls \ - --disable-rpath - popd - - touch stamps/make-configure -fi - -if [ ! -f stamps/make-build ]; then - pushd make-build - make $BUILD_NUM_JOBS - popd - - touch stamps/make-build -fi - -if [ ! -f stamps/make-install ]; then - pushd make-build - make install - popd - - touch stamps/make-install -fi - -rm -rf "${SCRIPT_DIR}"/make-*.patch -rm -rf "${SCRIPT_DIR}"/tarballs -rm -rf "${SCRIPT_DIR}"/*-source -rm -rf "${SCRIPT_DIR}"/*-build -rm -rf "${SCRIPT_DIR}"/stamps -exit 0 diff --git a/scripts/build/win64/build-win64-toolchain.sh b/scripts/build/win64/build-win64-toolchain.sh deleted file mode 100644 index 3bfcfb0..0000000 --- a/scripts/build/win64/build-win64-toolchain.sh +++ /dev/null @@ -1,330 +0,0 @@ -#!/bin/bash -set -eu - -# -# N64 (for windows) GCC/BINUTILS/NEWLIB/GDB toolchain build script. -# -# Attributions: -# Tyler J. Stachecki -# Robin Jones (NetworkFusion/JonesAlmighty) -# -# This script builds library source covered under the 'GNU LESSER GENERAL PUBLIC LICENSE' -# However, the original source is not changed. -# The repo 'LICENSE' is added for assurance. -# - -# Parallel GCC build jobs -NUM_CPU_THREADS=`grep -c '^processor' /proc/cpuinfo` #$(nproc) -BUILD_NUM_JOBS="--jobs=$NUM_CPU_THREADS --load-average=$NUM_CPU_THREADS" - -GMP="https://ftp.gnu.org/gnu/gmp/gmp-6.2.1.tar.xz" # No gz file available! -MPC="https://ftp.gnu.org/gnu/mpc/mpc-1.2.1.tar.gz" -MPFR="https://ftp.gnu.org/gnu/mpfr/mpfr-4.1.0.tar.gz" -BINUTILS="https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz" -GCC="https://ftp.gnu.org/gnu/gcc/gcc-11.3.0/gcc-11.3.0.tar.gz" -NEWLIB="https://sourceware.org/pub/newlib/newlib-4.1.0.tar.gz" -GDB="https://ftp.gnu.org/gnu/gdb/gdb-10.2.tar.gz" # fails to x compile on 11.2. requires investigation! - -BUILD=${BUILD:-x86_64-linux-gnu} -HOST=${HOST:-x86_64-w64-mingw32} - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd ${SCRIPT_DIR} && mkdir -p {stamps,tarballs} - -export PATH="${PATH}:${SCRIPT_DIR}/bin:${SCRIPT_DIR}/../linux64/bin" - -if [ ! -f stamps/binutils-download ]; then - wget "${BINUTILS}" -O "tarballs/$(basename ${BINUTILS})" - touch stamps/binutils-download -fi - -if [ ! -f stamps/binutils-extract ]; then - mkdir -p binutils-{build,source} - tar -xf tarballs/$(basename ${BINUTILS}) -C binutils-source --strip 1 - touch stamps/binutils-extract -fi - -if [ ! -f stamps/binutils-configure ]; then - pushd binutils-build - ../binutils-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-cpu=mips64vr4300 \ - --with-lib-path="${SCRIPT_DIR}/lib" \ - --enable-64-bit-bfd \ - --enable-plugins \ - --enable-shared \ - --disable-gold \ - --disable-multilib \ - --disable-nls \ - --disable-rpath \ - --disable-static \ - --disable-werror - popd - - touch stamps/binutils-configure -fi - -if [ ! -f stamps/binutils-build ]; then - pushd binutils-build - make $BUILD_NUM_JOBS - popd - - touch stamps/binutils-build -fi - -if [ ! -f stamps/binutils-install ]; then - pushd binutils-build - make install-strip - popd - - touch stamps/binutils-install -fi - -if [ ! -f stamps/gmp-download ]; then - wget "${GMP}" -O "tarballs/$(basename ${GMP})" - touch stamps/gmp-download -fi - -if [ ! -f stamps/mpfr-download ]; then - wget "${MPFR}" -O "tarballs/$(basename ${MPFR})" - touch stamps/mpfr-download -fi - -if [ ! -f stamps/mpc-download ]; then - wget "${MPC}" -O "tarballs/$(basename ${MPC})" - touch stamps/mpc-download -fi - -if [ ! -f stamps/gcc-download ]; then - wget "${GCC}" -O "tarballs/$(basename ${GCC})" - touch stamps/gcc-download -fi - -if [ ! -f stamps/gcc-extract ]; then - mkdir -p gcc-{build,source} - tar -xf tarballs/$(basename ${GCC}) -C gcc-source --strip 1 - touch stamps/gcc-extract -fi - -if [ ! -f stamps/gmp-extract ]; then - mkdir -p gcc-source/gmp - tar -xf tarballs/$(basename ${GMP}) -C gcc-source/gmp --strip 1 - touch stamps/gmp-extract -fi - -if [ ! -f stamps/mpfr-extract ]; then - mkdir -p gcc-source/mpfr - tar -xf tarballs/$(basename ${MPFR}) -C gcc-source/mpfr --strip 1 - touch stamps/mpfr-extract -fi - -if [ ! -f stamps/mpc-extract ]; then - mkdir -p gcc-source/mpc - tar -xf tarballs/$(basename ${MPC}) -C gcc-source/mpc --strip 1 - touch stamps/mpc-extract -fi - -if [ ! -f stamps/gcc-configure ]; then - pushd gcc-build - ../gcc-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-arch=vr4300 \ - --with-tune=vr4300 \ - --enable-languages=c,c++ --without-headers --with-newlib \ - --with-gnu-as=${SCRIPT_DIR}/bin/mips64-elf-as.exe \ - --with-gnu-ld=${SCRIPT_DIR}/bin/mips64-elf-ld.exe \ - --enable-checking=release \ - --enable-shared \ - --enable-shared-libgcc \ - --disable-decimal-float \ - --disable-gold \ - --disable-libatomic \ - --disable-libgomp \ - --disable-libitm \ - --disable-libquadmath \ - --disable-libquadmath-support \ - --disable-libsanitizer \ - --disable-libssp \ - --disable-libunwind-exceptions \ - --disable-libvtv \ - --disable-multilib \ - --disable-nls \ - --disable-rpath \ - --disable-static \ - --disable-symvers \ - --disable-threads \ - --disable-win32-registry \ - --enable-lto \ - --enable-plugin \ - --without-included-gettext - popd - - touch stamps/gcc-configure -fi - -if [ ! -f stamps/gcc-build ]; then - pushd gcc-build - make $BUILD_NUM_JOBS all-gcc - popd - - touch stamps/gcc-build -fi - -if [ ! -f stamps/gcc-install ]; then - pushd gcc-build - make install-strip-gcc - popd - - # While not necessary, this is still a good idea. - pushd "${SCRIPT_DIR}/bin" - cp mips64-elf-{gcc,cc}.exe - popd - - touch stamps/gcc-install -fi - -if [ ! -f stamps/libgcc-build ]; then - pushd gcc-build - make $BUILD_NUM_JOBS all-target-libgcc - popd - - touch stamps/libgcc-build -fi - -if [ ! -f stamps/libgcc-install ]; then - pushd gcc-build - make install-target-libgcc - popd - - touch stamps/libgcc-install -fi - -if [ ! -f stamps/newlib-download ]; then - wget "${NEWLIB}" -O "tarballs/$(basename ${NEWLIB})" - touch stamps/newlib-download -fi - -if [ ! -f stamps/newlib-extract ]; then - mkdir -p newlib-{build,source} - tar -xf tarballs/$(basename ${NEWLIB}) -C newlib-source --strip 1 - touch stamps/newlib-extract -fi - -if [ ! -f stamps/newlib-configure ]; then - pushd newlib-build - CFLAGS="-O2 -DHAVE_ASSERT_FUNC -fomit-frame-pointer -ffast-math -fstrict-aliasing" \ - ../newlib-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-cpu=mips64vr4300 \ - --disable-bootstrap \ - --disable-build-poststage1-with-cxx \ - --disable-build-with-cxx \ - --disable-cloog-version-check \ - --disable-dependency-tracking \ - --disable-libada \ - --disable-libquadmath \ - --disable-libquadmath-support \ - --disable-maintainer-mode \ - --disable-malloc-debugging \ - --disable-multilib \ - --disable-newlib-atexit-alloc \ - --disable-newlib-hw-fp \ - --disable-newlib-iconv \ - --disable-newlib-io-float \ - --disable-newlib-io-long-double \ - --disable-newlib-io-long-long \ - --disable-newlib-mb \ - --disable-newlib-multithread \ - --disable-newlib-register-fini \ - --disable-newlib-supplied-syscalls \ - --disable-objc-gc \ - --enable-newlib-io-c99-formats \ - --enable-newlib-io-pos-args \ - --enable-newlib-reent-small \ - --with-endian=little \ - --without-cloog \ - --without-gmp \ - --without-mpc \ - --without-mpfr \ - --disable-libssp \ - --disable-threads \ - --disable-werror - popd - - touch stamps/newlib-configure -fi - -if [ ! -f stamps/newlib-build ]; then - pushd newlib-build - make $BUILD_NUM_JOBS - popd - - touch stamps/newlib-build -fi - -if [ ! -f stamps/newlib-install ]; then - pushd newlib-build - make install - popd - - touch stamps/newlib-install -fi - -if [ ! -f stamps/gdb-download ]; then - wget "${GDB}" -O "tarballs/$(basename ${GDB})" - touch stamps/gdb-download -fi - -if [ ! -f stamps/gdb-extract ]; then - mkdir -p gdb-{build,source} - tar -xf tarballs/$(basename ${GDB}) -C gdb-source --strip 1 - touch stamps/gdb-extract -fi - -if [ ! -f stamps/gdb-configure ]; then - pushd gdb-build - CFLAGS="" LDFLAGS="" \ - ../gdb-source/configure \ - --prefix="${SCRIPT_DIR}" \ - --build="$BUILD" \ - --host="$HOST" \ - --target=mips64-elf --with-arch=vr4300 \ - --disable-werror - popd - - touch stamps/gdb-configure -fi - -if [ ! -f stamps/gdb-build ]; then - pushd gdb-build - make $BUILD_NUM_JOBS - popd - - touch stamps/gdb-build -fi - -if [ ! -f stamps/gdb-install ]; then - pushd gdb-build - make install - popd - - # While not necessary, this is still a good idea. - #pushd "${SCRIPT_DIR}/bin" - #cp mips64-elf-{gdb,gdb-add-index}.exe - #popd - - touch stamps/gdb-install -fi - -rm -rf "${SCRIPT_DIR}"/tarballs -rm -rf "${SCRIPT_DIR}"/*-source -rm -rf "${SCRIPT_DIR}"/*-build -rm -rf "${SCRIPT_DIR}"/stamps -rm -rf "${SCRIPT_DIR}"/x86_64-w64-mingw32 -exit 0 diff --git a/scripts/build/win64/make-4.2.1.patch b/scripts/build/win64/make-4.2.1.patch deleted file mode 100644 index 61a3581..0000000 --- a/scripts/build/win64/make-4.2.1.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- clean/make-4.2/glob/glob.c 2013-10-20 17:14:38.000000000 +0000 -+++ make-4.2/glob/glob.c 2018-09-18 10:16:03.860886356 +0000 -@@ -208,7 +208,7 @@ - #endif /* __GNU_LIBRARY__ || __DJGPP__ */ - - --#if !defined __alloca && !defined __GNU_LIBRARY__ -+#if !defined __alloca && defined __GNU_LIBRARY__ - - # ifdef __GNUC__ - # undef alloca From 2bb27508b0efcf0163784c59cb36ac49189175dd Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 31 Dec 2022 01:53:54 +0000 Subject: [PATCH 02/55] fix yaml --- .github/workflows/build-toolchain.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 6388010..3ab095b 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -158,11 +158,11 @@ jobs: # if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v1 with: - draft: true - prerelease: true - name: "Vx.x.x-y" - #tag_name: "latest" - files: | - ./**/*.deb - ./**/*.rpm - ./**/*.zip + draft: true + prerelease: true + name: "Vx.x.x-y" + #tag_name: "latest" + files: | + ./**/*.deb + ./**/*.rpm + ./**/*.zip From d447481118533900d1ca3e442e2334a926671c82 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 31 Dec 2022 02:05:50 +0000 Subject: [PATCH 03/55] fix checkout --- .github/workflows/build-toolchain.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 3ab095b..4861da5 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -57,7 +57,8 @@ jobs: - name: Checkout Code uses: actions/checkout@v3 with: - repository: 'dragonminded/libgragon' + repository: dragonminded/libdragon + path: trunk fetch-depth: 1 # we only require the last check-in, unless we want to create a changelog. # Cache and restore dependencies instead of downloading them to increase build speed. From 204c3e40c3eb50a36f630cc5448981c378af84f9 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 31 Dec 2022 02:08:20 +0000 Subject: [PATCH 04/55] remove checkout path --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 4861da5..bad2703 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -58,7 +58,7 @@ jobs: uses: actions/checkout@v3 with: repository: dragonminded/libdragon - path: trunk +# path: trunk fetch-depth: 1 # we only require the last check-in, unless we want to create a changelog. # Cache and restore dependencies instead of downloading them to increase build speed. From 9f5088e8b8919c27b5ea261e1129db55e4e11188 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 31 Dec 2022 03:16:40 +0000 Subject: [PATCH 05/55] Work on CI. --- .github/workflows/build-toolchain.yml | 28 +++++++++++++++++++-------- README.md | 2 +- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index bad2703..0cba4e9 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -1,4 +1,4 @@ -# Copyright (c) libdragon 2022 +# Copyright (c) NetworkFusion 2022 # See LICENSE file in the project root for full license information. # This workflow will build the libdragon N64 GCC toolchain to keep it up-to-date. @@ -6,7 +6,7 @@ name: Build latest libdragon N64 MIPS GCC toolchain on: # This action will take about 40-70 minutes to run! - # It is designed to only fire if the GCC toolchain build file changes. + # TODO: Should actually do it on cron once a month (if not manually run). push: pull_request: @@ -20,8 +20,11 @@ jobs: matrix: include: [ { target-platform: Windows-x86_64, host: x86_64-w64-mingw32 }, +# { target-platform: Windows-i686, host: i686-w64-mingw32 }, { target-platform: Linux-x86_64, host: '' } ] + env: + GCC_VERSION: 12.2.0 steps: - name: Install native system build dependencies @@ -58,7 +61,6 @@ jobs: uses: actions/checkout@v3 with: repository: dragonminded/libdragon -# path: trunk fetch-depth: 1 # we only require the last check-in, unless we want to create a changelog. # Cache and restore dependencies instead of downloading them to increase build speed. @@ -69,7 +71,7 @@ jobs: path: | ./tools/**/*.tar.gz ./tools/**/*.tar.bz2 - key: ${{ runner.os }}-dependency-downloads + key: ${{ runner.os }}-dependency-downloads # TODO: concurrency errors may currently occur due to matrix, but they are the same files. - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} run: | @@ -79,6 +81,11 @@ jobs: sudo N64_INST=${{ runner.temp }}/n64-brew HOST=${{ matrix.host }} ./build-toolchain.sh continue-on-error: true + - name: Get GCC version from file + run: | + grep -o 'GCC_V=[^"]*' ./tools/build-toolchain.sh >> $GITHUB_ENV + continue-on-error: true + # https://fpm.readthedocs.io/en/v1.15.0/getting-started.html - name: Generate toolchain packages for UNIX based OS if: ${{ matrix.target-platform == 'Linux-x86_64' }} @@ -114,11 +121,11 @@ jobs: ${{ runner.temp }}/n64-brew/=/usr/local/ continue-on-error: true env: - Package_Name: n64brew-libdragon-toolchain - Package_Version: 12.2.0 # TODO: should bump in line with GCC version?! + Package_Name: gcc-toolchain-mips64-linux64 + Package_Version: ${{ env.GCC_VERSION }} # TODO: should bump in line with GCC version?! Package_Revision: ${{ github.run_id }} Package_License: GPL - Package_Description: libdragon GCC toolchain for the N64 + Package_Description: MIPS GCC toolchain for the N64 Package_Url: https://n64brew.com Package_Maintainer: N64 Brew Community @@ -150,7 +157,12 @@ jobs: - name: Download artifact uses: actions/download-artifact@v3 with: - name: toolchain-files + name: gcc-toolchain-mips64-Windows-x86_64 + + - name: Download artifact + uses: actions/download-artifact@v3 + with: + name: gcc-toolchain-mips64-Linux-x86_64 - name: Display structure of downloaded files run: ls -R diff --git a/README.md b/README.md index 7f49fb8..45a18b7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ sudo N64_INST=/usr/local/n64/ HOST=x86_64-w64-mingw32 ./build-toolchain.sh # Windows mips64-gcc-toolchain for the N64 This repo automatically generates the MIPS64 GCC toolchain to allow cross compilation for the N64. -The binaries can be downloaded and used as part of other build scripts/components which saves time (at least 30 minutes) when setting up a developer environment in order to build N64 libraries such as libdragon in a `Windows` environment. +The binaries can be downloaded (from releases) and used as part of other build scripts/components which saves time (at least 30 minutes) when setting up a developer environment in order to build N64 libraries such as libdragon in a `Windows` environment. [![Github Action CI](https://github.com/n64-tools/mips64-gcc-toolchain/actions/workflows/build-toolchain.yml/badge.svg)](https://github.com/n64-tools/mips64-gcc-toolchain/actions/workflows/build-toolchain.yml) From 2d8c3ddf67241c2abc01dd850d558e3c337b2efa Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 1 Jan 2023 17:24:28 +0000 Subject: [PATCH 06/55] Fix environment variable Fix path to windows toolchain --- .github/workflows/build-toolchain.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 0cba4e9..1e1f641 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -24,7 +24,7 @@ jobs: { target-platform: Linux-x86_64, host: '' } ] env: - GCC_VERSION: 12.2.0 + GCC_VERSION: 12.0.0 steps: - name: Install native system build dependencies @@ -83,7 +83,7 @@ jobs: - name: Get GCC version from file run: | - grep -o 'GCC_V=[^"]*' ./tools/build-toolchain.sh >> $GITHUB_ENV + echo "GCC_VERSION=$(grep -o 'GCC_V=[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_ENV continue-on-error: true # https://fpm.readthedocs.io/en/v1.15.0/getting-started.html @@ -173,9 +173,9 @@ jobs: with: draft: true prerelease: true - name: "Vx.x.x-y" + name: "V${{ env.GCC_VERSION }}-${{ github.run_id }}" #tag_name: "latest" files: | ./**/*.deb ./**/*.rpm - ./**/*.zip + ./gcc-toolchain-mips64-Windows-x86_64.zip From a03aba7563c9f544733a96fc35cb725017f2a339 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 1 Jan 2023 18:09:29 +0000 Subject: [PATCH 07/55] GCC path version tests --- .github/workflows/build-toolchain.yml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 1e1f641..f9bfc4d 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -10,6 +10,9 @@ on: push: pull_request: +env: + GCC_VERSION: 'x.x.x' + jobs: build-toolchain: # targets the oldest ubuntu image available to create valid packages for as many versions possible. @@ -23,8 +26,6 @@ jobs: # { target-platform: Windows-i686, host: i686-w64-mingw32 }, { target-platform: Linux-x86_64, host: '' } ] - env: - GCC_VERSION: 12.0.0 steps: - name: Install native system build dependencies @@ -73,6 +74,12 @@ jobs: ./tools/**/*.tar.bz2 key: ${{ runner.os }}-dependency-downloads # TODO: concurrency errors may currently occur due to matrix, but they are the same files. + - name: Get GCC version from file + run: | + echo grep -o 'GCC_V=[^"]*' ./tools/build-toolchain.sh + echo "GCC_VERSION=$(grep -o 'GCC_V=[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_ENV + continue-on-error: false + - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} run: | # required for newlib (as not the default?!) @@ -81,11 +88,6 @@ jobs: sudo N64_INST=${{ runner.temp }}/n64-brew HOST=${{ matrix.host }} ./build-toolchain.sh continue-on-error: true - - name: Get GCC version from file - run: | - echo "GCC_VERSION=$(grep -o 'GCC_V=[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_ENV - continue-on-error: true - # https://fpm.readthedocs.io/en/v1.15.0/getting-started.html - name: Generate toolchain packages for UNIX based OS if: ${{ matrix.target-platform == 'Linux-x86_64' }} From 3a9fd2ad19a6bac87e9b03c9b0e67295affac62c Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 1 Jan 2023 18:25:11 +0000 Subject: [PATCH 08/55] Only output the version from GCC string. --- .github/workflows/build-toolchain.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index f9bfc4d..e914be2 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -76,8 +76,7 @@ jobs: - name: Get GCC version from file run: | - echo grep -o 'GCC_V=[^"]*' ./tools/build-toolchain.sh - echo "GCC_VERSION=$(grep -o 'GCC_V=[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_ENV + echo "GCC_VERSION=$(grep -o 'GCC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_ENV continue-on-error: false - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} From 1ea6a032049c0709dfd4f7e03b42f14a77db08e2 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 1 Jan 2023 18:26:56 +0000 Subject: [PATCH 09/55] Try with P option --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index e914be2..56d92bd 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -76,7 +76,7 @@ jobs: - name: Get GCC version from file run: | - echo "GCC_VERSION=$(grep -o 'GCC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_ENV + echo "GCC_VERSION=$(grep -Po 'GCC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_ENV continue-on-error: false - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} From 6da283e41f96a8fa57b3dc3ba0186db511dd6798 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 1 Jan 2023 19:18:01 +0000 Subject: [PATCH 10/55] Improve release paths --- .github/workflows/build-toolchain.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 56d92bd..43d9a6b 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -159,11 +159,13 @@ jobs: uses: actions/download-artifact@v3 with: name: gcc-toolchain-mips64-Windows-x86_64 + path: ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64/gcc-toolchain-mips64/ - name: Download artifact uses: actions/download-artifact@v3 with: name: gcc-toolchain-mips64-Linux-x86_64 + path: ${{ runner.temp }}/gcc-toolchain-mips64-Linux-x86_64 - name: Display structure of downloaded files run: ls -R @@ -175,8 +177,8 @@ jobs: draft: true prerelease: true name: "V${{ env.GCC_VERSION }}-${{ github.run_id }}" - #tag_name: "latest" + tag_name: "latest" files: | - ./**/*.deb - ./**/*.rpm - ./gcc-toolchain-mips64-Windows-x86_64.zip + ${{ runner.temp }}/**/*.deb + ${{ runner.temp }}/**/*.rpm + ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64/**/* From 4fdbf394602615f69bf1f9c8206f91d4c28be384 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 1 Jan 2023 20:34:59 +0000 Subject: [PATCH 11/55] Use output var (rather than env) fix parse between jobs Improve windows path. --- .github/workflows/build-toolchain.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 43d9a6b..b998650 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -10,9 +10,6 @@ on: push: pull_request: -env: - GCC_VERSION: 'x.x.x' - jobs: build-toolchain: # targets the oldest ubuntu image available to create valid packages for as many versions possible. @@ -75,8 +72,9 @@ jobs: key: ${{ runner.os }}-dependency-downloads # TODO: concurrency errors may currently occur due to matrix, but they are the same files. - name: Get GCC version from file + id: gcc-version-generator run: | - echo "GCC_VERSION=$(grep -Po 'GCC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_ENV + echo "GCC_VERSION=$(grep -Po 'GCC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT continue-on-error: false - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} @@ -123,7 +121,7 @@ jobs: continue-on-error: true env: Package_Name: gcc-toolchain-mips64-linux64 - Package_Version: ${{ env.GCC_VERSION }} # TODO: should bump in line with GCC version?! + Package_Version: ${{ steps.gcc-version-generator.outputs.GCC_VERSION }} Package_Revision: ${{ github.run_id }} Package_License: GPL Package_Description: MIPS GCC toolchain for the N64 @@ -159,7 +157,7 @@ jobs: uses: actions/download-artifact@v3 with: name: gcc-toolchain-mips64-Windows-x86_64 - path: ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64/gcc-toolchain-mips64/ + path: ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64-temp/gcc-toolchain-mips64-Windows-x86_64 - name: Download artifact uses: actions/download-artifact@v3 @@ -176,9 +174,9 @@ jobs: with: draft: true prerelease: true - name: "V${{ env.GCC_VERSION }}-${{ github.run_id }}" + name: "V${{ steps.gcc-version-generator.outputs.GCC_VERSION }}-${{ github.run_id }}" tag_name: "latest" files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm - ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64/**/* + ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64-temp/ From 4afcf0b5eef83d980a83325c91c42c3e173adb04 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 1 Jan 2023 22:13:29 +0000 Subject: [PATCH 12/55] Test fix release variable set Test release windows package release --- .github/workflows/build-toolchain.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index b998650..734ac39 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -15,6 +15,8 @@ jobs: # targets the oldest ubuntu image available to create valid packages for as many versions possible. # TODO: move to using a docker container to support older versions. runs-on: ubuntu-20.04 + outputs: + gcc-version: ${{ steps.gcc-version-generator.outputs.GCC_VERSION }} strategy: fail-fast: false matrix: @@ -128,13 +130,20 @@ jobs: Package_Url: https://n64brew.com Package_Maintainer: N64 Brew Community - - name: Publish Windows-x86_64 Build Artifacts + - name: Compress Windows-x86_64 Build Artifacts + if: ${{ matrix.target-platform == 'Windows-x86_64' }} + run: | + cd ${{ runner.temp }}/n64-brew/ + zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64.zip * + continue-on-error: true + + - name: Publish Windows-x86_64 Build Artifact if: ${{ matrix.target-platform == 'Windows-x86_64' }} uses: actions/upload-artifact@v3 with: name: gcc-toolchain-mips64-${{ matrix.target-platform }} path: | - ${{ runner.temp }}/n64-brew + ${{ runner.temp }}/**/*.zip continue-on-error: true - name: Publish Linux-x86_64 Build Artifacts @@ -157,7 +166,7 @@ jobs: uses: actions/download-artifact@v3 with: name: gcc-toolchain-mips64-Windows-x86_64 - path: ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64-temp/gcc-toolchain-mips64-Windows-x86_64 + path: ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64 - name: Download artifact uses: actions/download-artifact@v3 @@ -166,7 +175,9 @@ jobs: path: ${{ runner.temp }}/gcc-toolchain-mips64-Linux-x86_64 - name: Display structure of downloaded files - run: ls -R + run: | + cd ${{ runner.temp }} + ls -R - name: Generate Draft Release # if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') @@ -174,9 +185,9 @@ jobs: with: draft: true prerelease: true - name: "V${{ steps.gcc-version-generator.outputs.GCC_VERSION }}-${{ github.run_id }}" + name: "V${{ build-toolchain.outputs.gcc-version }}-${{ github.run_id }}" tag_name: "latest" files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm - ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64-temp/ + ${{ runner.temp }}/**/*.zip From 12d7a056fa9483ddfff61856b668207f142e6d98 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 1 Jan 2023 22:15:33 +0000 Subject: [PATCH 13/55] fix var? --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 734ac39..4db631c 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -185,7 +185,7 @@ jobs: with: draft: true prerelease: true - name: "V${{ build-toolchain.outputs.gcc-version }}-${{ github.run_id }}" + name: "V${{ needs.build-toolchain.outputs.gcc-version }}-${{ github.run_id }}" tag_name: "latest" files: | ${{ runner.temp }}/**/*.deb From 2474fb89506f3b410d084722b73fb881a8dc8ef8 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 1 Jan 2023 23:35:17 +0000 Subject: [PATCH 14/55] Dont use tag. Add other bin versions. Improve comments. --- .github/workflows/build-toolchain.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 4db631c..9596f21 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -1,4 +1,4 @@ -# Copyright (c) NetworkFusion 2022 +# Copyright (c) NetworkFusion 2023 # See LICENSE file in the project root for full license information. # This workflow will build the libdragon N64 GCC toolchain to keep it up-to-date. @@ -73,10 +73,12 @@ jobs: ./tools/**/*.tar.bz2 key: ${{ runner.os }}-dependency-downloads # TODO: concurrency errors may currently occur due to matrix, but they are the same files. - - name: Get GCC version from file + - name: Get versions from toolchain file id: gcc-version-generator run: | + echo "BINUTILS_VERSION=$(grep -Po 'BINUTILS_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT echo "GCC_VERSION=$(grep -Po 'GCC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + echo "NEWLIB_VERSION=$(grep -Po 'NEWLIB_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT continue-on-error: false - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} @@ -179,15 +181,16 @@ jobs: cd ${{ runner.temp }} ls -R - - name: Generate Draft Release + - name: Generate Draft Pre-Release # if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v1 with: draft: true prerelease: true name: "V${{ needs.build-toolchain.outputs.gcc-version }}-${{ github.run_id }}" - tag_name: "latest" + # tag_name: "latest" files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm ${{ runner.temp }}/**/*.zip + # LICENSE From 18fae0f2a0dae0a841d1cf596f20495ccd0f5b54 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Mon, 2 Jan 2023 01:09:20 +0000 Subject: [PATCH 15/55] Generate automated changelog --- .github/workflows/build-toolchain.yml | 28 +++++++++---- .gitignore | 57 +++------------------------ INSTALLATION.md | 13 ++++++ README.md | 10 +++-- 4 files changed, 45 insertions(+), 63 deletions(-) create mode 100644 INSTALLATION.md diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 9596f21..143cbd7 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -17,12 +17,13 @@ jobs: runs-on: ubuntu-20.04 outputs: gcc-version: ${{ steps.gcc-version-generator.outputs.GCC_VERSION }} + newlib-version: ${{ steps.gcc-version-generator.outputs.NEWLIB_VERSION }} + binutils-version: ${{ steps.gcc-version-generator.outputs.NEWLIB_VERSION }} strategy: fail-fast: false matrix: include: [ { target-platform: Windows-x86_64, host: x86_64-w64-mingw32 }, -# { target-platform: Windows-i686, host: i686-w64-mingw32 }, { target-platform: Linux-x86_64, host: '' } ] @@ -79,6 +80,11 @@ jobs: echo "BINUTILS_VERSION=$(grep -Po 'BINUTILS_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT echo "GCC_VERSION=$(grep -Po 'GCC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT echo "NEWLIB_VERSION=$(grep -Po 'NEWLIB_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + + # echo "GMP_VERSION=$(grep -Po 'GMP_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + # echo "MPC_VERSION=$(grep -Po 'MPC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + # echo "MPFR_VERSION=$(grep -Po 'MPFR_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + # echo "MAKE_VERSION=$(grep -Po 'MAKE_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT continue-on-error: false - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} @@ -145,7 +151,7 @@ jobs: with: name: gcc-toolchain-mips64-${{ matrix.target-platform }} path: | - ${{ runner.temp }}/**/*.zip + ${{ runner.temp }}/**/*.zip # uploads a zip which is in a zip! On the plus side, keeps the size down! continue-on-error: true - name: Publish Linux-x86_64 Build Artifacts @@ -176,10 +182,14 @@ jobs: name: gcc-toolchain-mips64-Linux-x86_64 path: ${{ runner.temp }}/gcc-toolchain-mips64-Linux-x86_64 - - name: Display structure of downloaded files + - name: Generate Changelog run: | - cd ${{ runner.temp }} - ls -R + $CHANGELOG_TEXT = "Updates toolchain dependencies to:\r\n" + $CHANGELOG_TEXT += " * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" + $CHANGELOG_TEXT += " * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" + $CHANGELOG_TEXT += " * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" + + echo $CHANGELOG_TEXT > ${{ github.workspace }}/CHANGELOG.txt - name: Generate Draft Pre-Release # if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') @@ -187,10 +197,12 @@ jobs: with: draft: true prerelease: true - name: "V${{ needs.build-toolchain.outputs.gcc-version }}-${{ github.run_id }}" - # tag_name: "latest" + name: "V${{ needs.build-toolchain.outputs.gcc-version }}-${{ github.run_id }}" # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. + # tag_name: "latest" # uses GH run id as default, using latest causes issues as it tries to create a tag that already exists. files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm ${{ runner.temp }}/**/*.zip - # LICENSE + LICENSE + CHANGELOG.txt + INSTALLATION.md # TODO: should this be markdown or converted to text (it is readable anyway). diff --git a/.gitignore b/.gitignore index 32f752f..942be1a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,54 +1,9 @@ -# Prerequisites -*.d - -# Object files -*.o -*.ko +# Generated debug files +*.zip +*.bin *.obj -*.elf - -# Linker output -*.ilk -*.map -*.exp - -# Precompiled Headers -*.gch -*.pch - -# Libraries -*.lib -*.a -*.la -*.lo - -# Shared objects (inc. Windows DLLs) -*.dll -*.so -*.so.* -*.dylib - -# Executables -*.exe -*.out -*.app -*.i*86 -*.x86_64 -*.hex - -# Debug files -*.dSYM/ -*.su -*.idb -*.pdb - -# Kernel Module Compile Results -*.mod* -*.cmd -.tmp_versions/ -modules.order -Module.symvers -Mkfile.old -dkms.conf +*.tar.* +*.deb +*.rpm .vs/ diff --git a/INSTALLATION.md b/INSTALLATION.md new file mode 100644 index 0000000..c775c40 --- /dev/null +++ b/INSTALLATION.md @@ -0,0 +1,13 @@ +# Installing packages + +## Operating System + + +## Debian +.deb + +## Redhat +.rpm + +## Windows +.zip diff --git a/README.md b/README.md index 45a18b7..b5d1670 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,12 @@ -NOTE: This repo will be updated or deprecated in the near future as the libDragon toolchain now supports the ability to do the same thing using: +**NOTE:** This repo will be updated or deprecated in the near future as the [official libDragon](dragonminded/libgragon) toolchain now supports the ability to do the same thing using: ``` sudo apt-get install -y mingw-w64 cd ./tools/ sudo N64_INST=/usr/local/n64/ HOST=x86_64-w64-mingw32 ./build-toolchain.sh ``` -# Windows mips64-gcc-toolchain for the N64 + +# mips64-gcc-toolchain for the N64 This repo automatically generates the MIPS64 GCC toolchain to allow cross compilation for the N64. The binaries can be downloaded (from releases) and used as part of other build scripts/components which saves time (at least 30 minutes) when setting up a developer environment in order to build N64 libraries such as libdragon in a `Windows` environment. @@ -14,5 +15,6 @@ The binaries can be downloaded (from releases) and used as part of other build s Architecture | Download Links --- | --- -Windows x64 | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-win64.zip) -Windows i386 | none currently available! +Windows x86_x64 | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-win64.zip) +Debian | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64.deb) +Redhat | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64.rpm) From 8696a8b108d76e925856ec71b94584cbfb41bc6a Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Mon, 2 Jan 2023 01:21:57 +0000 Subject: [PATCH 16/55] Improve changelog for release. --- .github/workflows/build-toolchain.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 143cbd7..82f66da 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -184,7 +184,7 @@ jobs: - name: Generate Changelog run: | - $CHANGELOG_TEXT = "Updates toolchain dependencies to:\r\n" + $CHANGELOG_TEXT = "Uses toolchain dependencies:\r\n" $CHANGELOG_TEXT += " * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" $CHANGELOG_TEXT += " * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" $CHANGELOG_TEXT += " * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" @@ -197,6 +197,7 @@ jobs: with: draft: true prerelease: true + body_path: CHANGELOG.txt name: "V${{ needs.build-toolchain.outputs.gcc-version }}-${{ github.run_id }}" # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. # tag_name: "latest" # uses GH run id as default, using latest causes issues as it tries to create a tag that already exists. files: | @@ -204,5 +205,4 @@ jobs: ${{ runner.temp }}/**/*.rpm ${{ runner.temp }}/**/*.zip LICENSE - CHANGELOG.txt INSTALLATION.md # TODO: should this be markdown or converted to text (it is readable anyway). From 7149997a8bf5ef0a869ff7cfbdf42f22a8f83cc6 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Mon, 2 Jan 2023 01:23:08 +0000 Subject: [PATCH 17/55] Always use `latest` for release might fail to overwrite on later runs (needs checking)! --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 82f66da..289048e 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -198,7 +198,7 @@ jobs: draft: true prerelease: true body_path: CHANGELOG.txt - name: "V${{ needs.build-toolchain.outputs.gcc-version }}-${{ github.run_id }}" # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. + name: "V${{ needs.build-toolchain.outputs.gcc-version }}-latest # ${{ github.run_id }}" # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. # tag_name: "latest" # uses GH run id as default, using latest causes issues as it tries to create a tag that already exists. files: | ${{ runner.temp }}/**/*.deb From 14aefb9919151dbd77388dcdfec099aa00461881 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Mon, 2 Jan 2023 03:01:20 +0000 Subject: [PATCH 18/55] Update build-toolchain.yml Update search path --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 289048e..7089cf6 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -151,7 +151,7 @@ jobs: with: name: gcc-toolchain-mips64-${{ matrix.target-platform }} path: | - ${{ runner.temp }}/**/*.zip # uploads a zip which is in a zip! On the plus side, keeps the size down! + ${{ runner.temp }}/*.zip # uploads a zip which is in a zip! On the plus side, keeps the size down! continue-on-error: true - name: Publish Linux-x86_64 Build Artifacts From 1d159fe227d0933a745cbedd45bea36ce0e3d274 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 3 Jan 2023 15:33:56 +0000 Subject: [PATCH 19/55] Fix artifact path --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 289048e..fafadf3 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -151,7 +151,7 @@ jobs: with: name: gcc-toolchain-mips64-${{ matrix.target-platform }} path: | - ${{ runner.temp }}/**/*.zip # uploads a zip which is in a zip! On the plus side, keeps the size down! + ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64.zip # uploads a zip which is in a zip! On the plus side, keeps the size down! continue-on-error: true - name: Publish Linux-x86_64 Build Artifacts From 3d91157a25730a160de871b162aae900feb42df9 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 3 Jan 2023 16:31:25 +0000 Subject: [PATCH 20/55] Compress windows toolchain in release job Should fix artifact upload. Improve changelog. --- .github/workflows/build-toolchain.yml | 30 ++++++++++++++++----------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index fafadf3..f2029b3 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -19,6 +19,10 @@ jobs: gcc-version: ${{ steps.gcc-version-generator.outputs.GCC_VERSION }} newlib-version: ${{ steps.gcc-version-generator.outputs.NEWLIB_VERSION }} binutils-version: ${{ steps.gcc-version-generator.outputs.NEWLIB_VERSION }} + gmp-version: ${{ steps.gcc-version-generator.outputs.GMP_VERSION }} + mpc-version: ${{ steps.gcc-version-generator.outputs.MPC_VERSION }} + mpfr-version: ${{ steps.gcc-version-generator.outputs.MPFR_VERSION }} +# make-version: ${{ steps.gcc-version-generator.outputs.MAKE_VERSION }} strategy: fail-fast: false matrix: @@ -81,9 +85,9 @@ jobs: echo "GCC_VERSION=$(grep -Po 'GCC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT echo "NEWLIB_VERSION=$(grep -Po 'NEWLIB_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT - # echo "GMP_VERSION=$(grep -Po 'GMP_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT - # echo "MPC_VERSION=$(grep -Po 'MPC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT - # echo "MPFR_VERSION=$(grep -Po 'MPFR_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + echo "GMP_VERSION=$(grep -Po 'GMP_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + echo "MPC_VERSION=$(grep -Po 'MPC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + echo "MPFR_VERSION=$(grep -Po 'MPFR_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT # echo "MAKE_VERSION=$(grep -Po 'MAKE_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT continue-on-error: false @@ -138,20 +142,13 @@ jobs: Package_Url: https://n64brew.com Package_Maintainer: N64 Brew Community - - name: Compress Windows-x86_64 Build Artifacts - if: ${{ matrix.target-platform == 'Windows-x86_64' }} - run: | - cd ${{ runner.temp }}/n64-brew/ - zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64.zip * - continue-on-error: true - - name: Publish Windows-x86_64 Build Artifact if: ${{ matrix.target-platform == 'Windows-x86_64' }} uses: actions/upload-artifact@v3 with: name: gcc-toolchain-mips64-${{ matrix.target-platform }} path: | - ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64.zip # uploads a zip which is in a zip! On the plus side, keeps the size down! + ${{ runner.temp }}/n64-brew continue-on-error: true - name: Publish Linux-x86_64 Build Artifacts @@ -188,9 +185,18 @@ jobs: $CHANGELOG_TEXT += " * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" $CHANGELOG_TEXT += " * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" $CHANGELOG_TEXT += " * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" - + $CHANGELOG_TEXT += " * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" + $CHANGELOG_TEXT += " * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" + $CHANGELOG_TEXT += " * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" + # $CHANGELOG_TEXT += " * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" echo $CHANGELOG_TEXT > ${{ github.workspace }}/CHANGELOG.txt + - name: Compress Windows-x86_64 Artifacts + run: | + cd ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64 + zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64.zip * + continue-on-error: true + - name: Generate Draft Pre-Release # if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v1 From 0e7961aee3fdcee5ff9ba092f938782553fea55c Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 3 Jan 2023 16:59:25 +0000 Subject: [PATCH 21/55] Include makefile in build for windows. --- .github/workflows/build-toolchain.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index f2029b3..007e33c 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -27,8 +27,8 @@ jobs: fail-fast: false matrix: include: [ - { target-platform: Windows-x86_64, host: x86_64-w64-mingw32 }, - { target-platform: Linux-x86_64, host: '' } + { target-platform: Windows-x86_64, host: x86_64-w64-mingw32, makefile-version: 4.4 }, + { target-platform: Linux-x86_64, host: '', makefile-version: '' } ] steps: @@ -96,7 +96,7 @@ jobs: # required for newlib (as not the default?!) export PATH="$PATH:${{ runner.temp }}/n64-brew" cd ./tools/ - sudo N64_INST=${{ runner.temp }}/n64-brew HOST=${{ matrix.host }} ./build-toolchain.sh + sudo N64_INST=${{ runner.temp }}/n64-brew HOST=${{ matrix.host }} MAKE_V=${{ matrix.makefile-version }} ./build-toolchain.sh continue-on-error: true # https://fpm.readthedocs.io/en/v1.15.0/getting-started.html From 5ede029a2bd89d7410ee501e59298a9521625d20 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 3 Jan 2023 18:05:34 +0000 Subject: [PATCH 22/55] Fix changelog Fix documentation by downloading repo tag again --- .github/workflows/build-toolchain.yml | 30 +++++++++++++++------------ 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 007e33c..7b4ded7 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -167,13 +167,17 @@ jobs: needs: build-toolchain steps: - - name: Download artifact + - uses: actions/checkout@v3 + + - name: Download Windows artifact + id: download-windows-artifact uses: actions/download-artifact@v3 with: name: gcc-toolchain-mips64-Windows-x86_64 path: ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64 - - name: Download artifact + - name: Download Linux artifact + id: download-linux-artifact uses: actions/download-artifact@v3 with: name: gcc-toolchain-mips64-Linux-x86_64 @@ -181,15 +185,15 @@ jobs: - name: Generate Changelog run: | - $CHANGELOG_TEXT = "Uses toolchain dependencies:\r\n" - $CHANGELOG_TEXT += " * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" - $CHANGELOG_TEXT += " * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" - $CHANGELOG_TEXT += " * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" - $CHANGELOG_TEXT += " * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" - $CHANGELOG_TEXT += " * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" - $CHANGELOG_TEXT += " * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" - # $CHANGELOG_TEXT += " * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" - echo $CHANGELOG_TEXT > ${{ github.workspace }}/CHANGELOG.txt + $CHANGELOG_TEXT= "Uses toolchain dependencies:\r\n" + $CHANGELOG_TEXT+= " * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" + $CHANGELOG_TEXT+= " * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" + $CHANGELOG_TEXT+= " * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" + $CHANGELOG_TEXT+= " * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" + $CHANGELOG_TEXT+= " * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" + $CHANGELOG_TEXT+= " * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" + # $CHANGELOG_TEXT+= " * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" + echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG.txt - name: Compress Windows-x86_64 Artifacts run: | @@ -205,10 +209,10 @@ jobs: prerelease: true body_path: CHANGELOG.txt name: "V${{ needs.build-toolchain.outputs.gcc-version }}-latest # ${{ github.run_id }}" # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. - # tag_name: "latest" # uses GH run id as default, using latest causes issues as it tries to create a tag that already exists. + tag_name: "latest" files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm - ${{ runner.temp }}/**/*.zip + ${{ runner.temp }}/**/*.zip # could use ${{ steps.download-windows-artifact.outputs.download-path }} LICENSE INSTALLATION.md # TODO: should this be markdown or converted to text (it is readable anyway). From 20889600de2cb68b9cc4e7966d83c1bc7dca8a2a Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 3 Jan 2023 19:21:56 +0000 Subject: [PATCH 23/55] Test changelog --- .github/workflows/build-toolchain.yml | 29 ++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 7b4ded7..dd2cd65 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -91,6 +91,17 @@ jobs: # echo "MAKE_VERSION=$(grep -Po 'MAKE_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT continue-on-error: false + - name: Test Generate Changelog # TODO: remove if works! + run: | + CHANGELOG_TEXT="Uses toolchain dependencies:\r\n" + CHANGELOG_TEXT+=" * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" + CHANGELOG_TEXT+=" * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" + CHANGELOG_TEXT+=" * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" + CHANGELOG_TEXT+=" * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" + CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" + CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" + # CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" + echo "CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG.txt - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} run: | # required for newlib (as not the default?!) @@ -185,15 +196,15 @@ jobs: - name: Generate Changelog run: | - $CHANGELOG_TEXT= "Uses toolchain dependencies:\r\n" - $CHANGELOG_TEXT+= " * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" - $CHANGELOG_TEXT+= " * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" - $CHANGELOG_TEXT+= " * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" - $CHANGELOG_TEXT+= " * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" - $CHANGELOG_TEXT+= " * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" - $CHANGELOG_TEXT+= " * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" - # $CHANGELOG_TEXT+= " * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" - echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG.txt + CHANGELOG_TEXT="Uses toolchain dependencies:\r\n" + CHANGELOG_TEXT+=" * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" + CHANGELOG_TEXT+=" * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" + CHANGELOG_TEXT+=" * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" + CHANGELOG_TEXT+=" * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" + CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" + CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" + # CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" + echo "CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG.txt - name: Compress Windows-x86_64 Artifacts run: | From db34dce6ee2a38e349bec9b09b5e9116af0d09de Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 3 Jan 2023 21:31:15 +0000 Subject: [PATCH 24/55] fix windows artifacts on release --- .github/workflows/build-toolchain.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index dd2cd65..1f00b49 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -91,17 +91,6 @@ jobs: # echo "MAKE_VERSION=$(grep -Po 'MAKE_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT continue-on-error: false - - name: Test Generate Changelog # TODO: remove if works! - run: | - CHANGELOG_TEXT="Uses toolchain dependencies:\r\n" - CHANGELOG_TEXT+=" * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" - CHANGELOG_TEXT+=" * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" - CHANGELOG_TEXT+=" * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" - CHANGELOG_TEXT+=" * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" - CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" - CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" - # CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" - echo "CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG.txt - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} run: | # required for newlib (as not the default?!) @@ -204,7 +193,7 @@ jobs: CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" # CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" - echo "CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG.txt + echo "CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG - name: Compress Windows-x86_64 Artifacts run: | @@ -218,12 +207,13 @@ jobs: with: draft: true prerelease: true - body_path: CHANGELOG.txt + body_path: CHANGELOG name: "V${{ needs.build-toolchain.outputs.gcc-version }}-latest # ${{ github.run_id }}" # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. - tag_name: "latest" + tag_name: "latest-test" files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm - ${{ runner.temp }}/**/*.zip # could use ${{ steps.download-windows-artifact.outputs.download-path }} + ${{ steps.download-windows-artifact.outputs.download-path }} LICENSE - INSTALLATION.md # TODO: should this be markdown or converted to text (it is readable anyway). +# TODO: should this be markdown or converted to text (it is readable anyway). + INSTALLATION.md From 1cf30d146f6362dd4eec6516cd8748c1afe2a0f8 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 3 Jan 2023 21:32:14 +0000 Subject: [PATCH 25/55] Fix release name --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 1f00b49..b860f6c 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -208,7 +208,7 @@ jobs: draft: true prerelease: true body_path: CHANGELOG - name: "V${{ needs.build-toolchain.outputs.gcc-version }}-latest # ${{ github.run_id }}" # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. + name: "V${{ needs.build-toolchain.outputs.gcc-version }}-latest-test" # ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. tag_name: "latest-test" files: | ${{ runner.temp }}/**/*.deb From 0a8992c5ed3dcd16759c0ab31877c50ba315f713 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 3 Jan 2023 21:33:37 +0000 Subject: [PATCH 26/55] fix yaml --- .github/workflows/build-toolchain.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index b860f6c..e7b3f70 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -208,7 +208,8 @@ jobs: draft: true prerelease: true body_path: CHANGELOG - name: "V${{ needs.build-toolchain.outputs.gcc-version }}-latest-test" # ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. +# ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. + name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-latest-test' tag_name: "latest-test" files: | ${{ runner.temp }}/**/*.deb From 46af91e6feb995ee656794bf825f3a36766a0d46 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 3 Jan 2023 21:34:37 +0000 Subject: [PATCH 27/55] Further fix yaml --- .github/workflows/build-toolchain.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index e7b3f70..7df3f44 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -202,13 +202,13 @@ jobs: continue-on-error: true - name: Generate Draft Pre-Release -# if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') + # if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v1 with: draft: true prerelease: true body_path: CHANGELOG -# ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. + # ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-latest-test' tag_name: "latest-test" files: | From 75007bede34a4b6745528f081ba2e77b5652d959 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 3 Jan 2023 22:25:44 +0000 Subject: [PATCH 28/55] Further fix invalid yaml --- .github/workflows/build-toolchain.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 7df3f44..ba5b641 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -195,12 +195,8 @@ jobs: # CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" echo "CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG - - name: Compress Windows-x86_64 Artifacts - run: | - cd ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64 - zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64.zip * - continue-on-error: true - +# TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. +# TODO: INSTALLATION.md should this be markdown or converted to text (it is readable anyway). - name: Generate Draft Pre-Release # if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v1 @@ -208,7 +204,6 @@ jobs: draft: true prerelease: true body_path: CHANGELOG - # ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-latest-test' tag_name: "latest-test" files: | @@ -216,5 +211,4 @@ jobs: ${{ runner.temp }}/**/*.rpm ${{ steps.download-windows-artifact.outputs.download-path }} LICENSE -# TODO: should this be markdown or converted to text (it is readable anyway). INSTALLATION.md From f664967980a2fb035c1444fcd246979cf2857172 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 3 Jan 2023 23:48:04 +0000 Subject: [PATCH 29/55] Fix changelog text and win path. --- .github/workflows/build-toolchain.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index ba5b641..bd2bbc2 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -193,7 +193,7 @@ jobs: CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" # CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" - echo "CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG + echo CHANGELOG_TEXT > ${{ github.workspace }}/CHANGELOG # TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. # TODO: INSTALLATION.md should this be markdown or converted to text (it is readable anyway). @@ -209,6 +209,6 @@ jobs: files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm - ${{ steps.download-windows-artifact.outputs.download-path }} + ${{ steps.download-windows-artifact.outputs.download-path }}/* LICENSE INSTALLATION.md From 81e02b495deb33f758920de2d97212d960d1ff97 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Wed, 4 Jan 2023 00:55:30 +0000 Subject: [PATCH 30/55] upload whole path --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index bd2bbc2..60ff4fd 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -209,6 +209,6 @@ jobs: files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm - ${{ steps.download-windows-artifact.outputs.download-path }}/* + ${{ steps.download-windows-artifact.outputs.download-path }} LICENSE INSTALLATION.md From 40365e02e1952358d72539ddccaeb98b4f928d35 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Thu, 5 Jan 2023 14:45:04 +0000 Subject: [PATCH 31/55] try new path --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 60ff4fd..bd2bbc2 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -209,6 +209,6 @@ jobs: files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm - ${{ steps.download-windows-artifact.outputs.download-path }} + ${{ steps.download-windows-artifact.outputs.download-path }}/* LICENSE INSTALLATION.md From d693ad4dd20a14805e5347aeb5116fe67cefc76b Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Thu, 5 Jan 2023 15:55:33 +0000 Subject: [PATCH 32/55] test package changes work on windows files upload --- .github/workflows/build-toolchain.yml | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index bd2bbc2..0e888ad 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -103,6 +103,16 @@ jobs: - name: Generate toolchain packages for UNIX based OS if: ${{ matrix.target-platform == 'Linux-x86_64' }} run: | + + # Create a folder packages can control + mkdir -p ${{ runner.temp }}/packages + + # Move and make executable lowercase (otherwise could be issues) + cp -R $Source_Directory_Path ${{ runner.temp }}/packages + + # base directory for package generation + cd ${{ runner.temp }}/packages + echo Generating debian package fpm \ -t deb \ @@ -116,7 +126,7 @@ jobs: --description "$Package_Description" \ --url "$Package_Url" \ --maintainer "$Package_Maintainer" \ - ${{ runner.temp }}/n64-brew/=/usr/local/ + N64_INST=$Installation_Directory_Path echo Generating rpm package fpm \ @@ -131,10 +141,12 @@ jobs: --description "$Package_Description" \ --url "$Package_Url" \ --maintainer "$Package_Maintainer" \ - ${{ runner.temp }}/n64-brew/=/usr/local/ + N64_INST=$Installation_Directory_Path continue-on-error: true env: Package_Name: gcc-toolchain-mips64-linux64 + Source_Directory_Path: ${{ runner.temp }}/n64-brew/ + Installation_Directory_Path: /usr/local/ Package_Version: ${{ steps.gcc-version-generator.outputs.GCC_VERSION }} Package_Revision: ${{ github.run_id }} Package_License: GPL @@ -193,7 +205,12 @@ jobs: CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" # CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" - echo CHANGELOG_TEXT > ${{ github.workspace }}/CHANGELOG + echo $CHANGELOG_TEXT > ${{ github.workspace }}/CHANGELOG + + - name: Test files path + run: | + cd ${{ steps.download-windows-artifact.outputs.download-path }} + ls -R # TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. # TODO: INSTALLATION.md should this be markdown or converted to text (it is readable anyway). @@ -209,6 +226,6 @@ jobs: files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm - ${{ steps.download-windows-artifact.outputs.download-path }}/* + ${{ steps.download-windows-artifact.outputs.download-path }}/**/* LICENSE INSTALLATION.md From d15a9a20dd65d00edba868724fdbb16b150f4f07 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Thu, 5 Jan 2023 17:14:30 +0000 Subject: [PATCH 33/55] Zip windows artifact Revert package changes --- .github/workflows/build-toolchain.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 0e888ad..6b7d7be 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -103,16 +103,6 @@ jobs: - name: Generate toolchain packages for UNIX based OS if: ${{ matrix.target-platform == 'Linux-x86_64' }} run: | - - # Create a folder packages can control - mkdir -p ${{ runner.temp }}/packages - - # Move and make executable lowercase (otherwise could be issues) - cp -R $Source_Directory_Path ${{ runner.temp }}/packages - - # base directory for package generation - cd ${{ runner.temp }}/packages - echo Generating debian package fpm \ -t deb \ @@ -126,7 +116,7 @@ jobs: --description "$Package_Description" \ --url "$Package_Url" \ --maintainer "$Package_Maintainer" \ - N64_INST=$Installation_Directory_Path + ${{ runner.temp }}/n64-brew/=/usr/local/ echo Generating rpm package fpm \ @@ -141,12 +131,10 @@ jobs: --description "$Package_Description" \ --url "$Package_Url" \ --maintainer "$Package_Maintainer" \ - N64_INST=$Installation_Directory_Path + ${{ runner.temp }}/n64-brew/=/usr/local/ continue-on-error: true env: Package_Name: gcc-toolchain-mips64-linux64 - Source_Directory_Path: ${{ runner.temp }}/n64-brew/ - Installation_Directory_Path: /usr/local/ Package_Version: ${{ steps.gcc-version-generator.outputs.GCC_VERSION }} Package_Revision: ${{ github.run_id }} Package_License: GPL @@ -207,10 +195,12 @@ jobs: # CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" echo $CHANGELOG_TEXT > ${{ github.workspace }}/CHANGELOG - - name: Test files path + - name: Zip windows artifact run: | cd ${{ steps.download-windows-artifact.outputs.download-path }} ls -R + cd ${{ runner.temp }} + zip -r gcc-toolchain-mips64.zip ${{ steps.download-windows-artifact.outputs.download-path }} # TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. # TODO: INSTALLATION.md should this be markdown or converted to text (it is readable anyway). @@ -226,6 +216,6 @@ jobs: files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm - ${{ steps.download-windows-artifact.outputs.download-path }}/**/* + ${{ runner.temp }}/*.zip LICENSE INSTALLATION.md From 28dd2385319866b8a6435e305a07a6367dec66fa Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Thu, 5 Jan 2023 18:55:23 +0000 Subject: [PATCH 34/55] Improve zip file upload. --- .github/workflows/build-toolchain.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 6b7d7be..5eef11a 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -193,14 +193,14 @@ jobs: CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" # CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" - echo $CHANGELOG_TEXT > ${{ github.workspace }}/CHANGELOG + echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG - name: Zip windows artifact run: | cd ${{ steps.download-windows-artifact.outputs.download-path }} ls -R cd ${{ runner.temp }} - zip -r gcc-toolchain-mips64.zip ${{ steps.download-windows-artifact.outputs.download-path }} + zip -j gcc-toolchain-mips64-win64.zip ${{ steps.download-windows-artifact.outputs.download-path }}/* # TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. # TODO: INSTALLATION.md should this be markdown or converted to text (it is readable anyway). @@ -211,8 +211,9 @@ jobs: draft: true prerelease: true body_path: CHANGELOG - name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-latest-test' - tag_name: "latest-test" + generate_release_notes: false + name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-latest-prerelease' + tag_name: "toolchain-latest-prerelease" files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm From c7e3bd6f638b6b097ed15c63ee426140513a8d11 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Thu, 5 Jan 2023 20:18:41 +0000 Subject: [PATCH 35/55] further attempt at zip of windows artifacts --- .github/workflows/build-toolchain.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 5eef11a..c10b4db 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -192,15 +192,14 @@ jobs: CHANGELOG_TEXT+=" * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" + # CHANGELOG_TEXT+="Extra windows dependencies:\r\n" # CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG - name: Zip windows artifact run: | - cd ${{ steps.download-windows-artifact.outputs.download-path }} - ls -R cd ${{ runner.temp }} - zip -j gcc-toolchain-mips64-win64.zip ${{ steps.download-windows-artifact.outputs.download-path }}/* + zip -rj gcc-toolchain-mips64-win64.zip ${{ steps.download-windows-artifact.outputs.download-path }}/../* # TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. # TODO: INSTALLATION.md should this be markdown or converted to text (it is readable anyway). From 50fbd876997c155dbd9564bebfa504d9ee14162e Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Thu, 5 Jan 2023 21:08:48 +0000 Subject: [PATCH 36/55] Work on changelog. --- .github/workflows/build-toolchain.yml | 33 ++++++++++++++++++--------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index c10b4db..faf048d 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -22,7 +22,7 @@ jobs: gmp-version: ${{ steps.gcc-version-generator.outputs.GMP_VERSION }} mpc-version: ${{ steps.gcc-version-generator.outputs.MPC_VERSION }} mpfr-version: ${{ steps.gcc-version-generator.outputs.MPFR_VERSION }} -# make-version: ${{ steps.gcc-version-generator.outputs.MAKE_VERSION }} + make-version: ${{ steps.gcc-version-generator.outputs.MAKE_VERSION }} strategy: fail-fast: false matrix: @@ -88,7 +88,8 @@ jobs: echo "GMP_VERSION=$(grep -Po 'GMP_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT echo "MPC_VERSION=$(grep -Po 'MPC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT echo "MPFR_VERSION=$(grep -Po 'MPFR_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT - # echo "MAKE_VERSION=$(grep -Po 'MAKE_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + # TODO: this version is set explicitly. We need to fix! + echo "MAKE_VERSION=4.4" >> $GITHUB_OUTPUT continue-on-error: false - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} @@ -185,15 +186,25 @@ jobs: - name: Generate Changelog run: | - CHANGELOG_TEXT="Uses toolchain dependencies:\r\n" - CHANGELOG_TEXT+=" * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" - CHANGELOG_TEXT+=" * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" - CHANGELOG_TEXT+=" * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" - CHANGELOG_TEXT+=" * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" - CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" - CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" - # CHANGELOG_TEXT+="Extra windows dependencies:\r\n" - # CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" + BASE_TOOLCHAIN_DEPENDENCIES = [ + ("GCC", "gcc-version"), + ("Newlib", "newlib-version"), + ("BinUtils", "binutils-version") + ] + PROBABLE_TOOLCHAIN_DEPENDENCIES = [ + ("GMP", "gmp-version"), + ("MPC", "mpc-version"), + ("MPFR", "mpfr-version") + ] + WINDOWS_TOOLCHAIN_DEPENDENCIES = [ + ("MAKEFILE", "make-version") + ] + CHANGELOG_TEXT = "Uses toolchain dependencies:\r\n" + for name, version in BASE_TOOLCHAIN_DEPENDENCIES: + CHANGELOG_TEXT += f" * {name}: V{needs.build-toolchain.outputs[version]}\r\n" + CHANGELOG_TEXT += "Uses probable extra dependencies:\r\n" + for name, version in PROBABLE_TOOLCHAIN_DEPENDENCIES: + CHANGELOG_TEXT += f" * {name}: V{needs.build-toolchain.outputs[version]}\r\n" echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG - name: Zip windows artifact From a9bc67cfd676a98c8839b7b34b418ee1eda4dd87 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Thu, 5 Jan 2023 21:47:33 +0000 Subject: [PATCH 37/55] Fix zip generation? --- .github/workflows/build-toolchain.yml | 24 +++++++++++++----------- INSTALLATION.md | 5 ++++- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index faf048d..1c379ec 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -46,20 +46,21 @@ jobs: sudo apt-get install -y mingw-w64 # If there are other dependencies, we should add them here and make sure the documentation is updated! - # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-ruby - - name: Set up Ruby - if: ${{ matrix.target-platform == 'Linux-x86_64' }} - uses: ruby/setup-ruby@v1 - with: - bundler-cache: true - ruby-version: '3.1' + # # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-ruby + # - name: Set up Ruby + # if: ${{ matrix.target-platform == 'Linux-x86_64' }} + # uses: ruby/setup-ruby@v1 + # with: + # bundler-cache: true + # ruby-version: '3.1' + # continue-on-error: true - name: Install Package Creator if: ${{ matrix.target-platform == 'Linux-x86_64' }} run: | echo installing jordansissel/fpm ruby package gem install fpm - fpm --version + # fpm --version continue-on-error: true - name: Checkout Code @@ -207,10 +208,11 @@ jobs: CHANGELOG_TEXT += f" * {name}: V{needs.build-toolchain.outputs[version]}\r\n" echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG - - name: Zip windows artifact + # Compress and move the windows folder ready for upload (not needed for local builds). + - name: Compress and move windows artifacts to $GITHUB_WORKSPACE/win64 run: | - cd ${{ runner.temp }} - zip -rj gcc-toolchain-mips64-win64.zip ${{ steps.download-windows-artifact.outputs.download-path }}/../* + cd ${{ steps.download-windows-artifact.outputs.download-path }} + zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-win64.zip * # TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. # TODO: INSTALLATION.md should this be markdown or converted to text (it is readable anyway). diff --git a/INSTALLATION.md b/INSTALLATION.md index c775c40..1444758 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -10,4 +10,7 @@ .rpm ## Windows -.zip +Download the .zip file and extract it. +Move the contained file. +Add the file path to an environment variable +Enjoy! From acd900a7dfa2a216e2950079fb67f188a6a06795 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Thu, 5 Jan 2023 21:47:58 +0000 Subject: [PATCH 38/55] Fix yaml for zip generation --- .github/workflows/build-toolchain.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 1c379ec..8f5449a 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -211,8 +211,8 @@ jobs: # Compress and move the windows folder ready for upload (not needed for local builds). - name: Compress and move windows artifacts to $GITHUB_WORKSPACE/win64 run: | - cd ${{ steps.download-windows-artifact.outputs.download-path }} - zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-win64.zip * + cd ${{ steps.download-windows-artifact.outputs.download-path }} + zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-win64.zip * # TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. # TODO: INSTALLATION.md should this be markdown or converted to text (it is readable anyway). From 808b7ebfd29354636415180e08703a7df34c6499 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Thu, 5 Jan 2023 22:47:39 +0000 Subject: [PATCH 39/55] Revert ruby change, got a permission error quickest way to solve as not too important. --- .github/workflows/build-toolchain.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 8f5449a..885ad31 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -46,21 +46,21 @@ jobs: sudo apt-get install -y mingw-w64 # If there are other dependencies, we should add them here and make sure the documentation is updated! - # # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-ruby - # - name: Set up Ruby - # if: ${{ matrix.target-platform == 'Linux-x86_64' }} - # uses: ruby/setup-ruby@v1 - # with: - # bundler-cache: true - # ruby-version: '3.1' - # continue-on-error: true + # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-ruby + - name: Set up Ruby + if: ${{ matrix.target-platform == 'Linux-x86_64' }} + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true + ruby-version: '3.1' + continue-on-error: true - name: Install Package Creator if: ${{ matrix.target-platform == 'Linux-x86_64' }} run: | echo installing jordansissel/fpm ruby package gem install fpm - # fpm --version + fpm --version continue-on-error: true - name: Checkout Code @@ -208,7 +208,7 @@ jobs: CHANGELOG_TEXT += f" * {name}: V{needs.build-toolchain.outputs[version]}\r\n" echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG - # Compress and move the windows folder ready for upload (not needed for local builds). + # Compress and move the windows folder ready for upload. - name: Compress and move windows artifacts to $GITHUB_WORKSPACE/win64 run: | cd ${{ steps.download-windows-artifact.outputs.download-path }} From 94c46130e008dc71cccbed6be7f1dcb062dce39c Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Fri, 6 Jan 2023 00:13:51 +0000 Subject: [PATCH 40/55] Revert changelog to something likely to work. --- .github/workflows/build-toolchain.yml | 31 ++++++++++----------------- 1 file changed, 11 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 885ad31..7944989 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -187,29 +187,20 @@ jobs: - name: Generate Changelog run: | - BASE_TOOLCHAIN_DEPENDENCIES = [ - ("GCC", "gcc-version"), - ("Newlib", "newlib-version"), - ("BinUtils", "binutils-version") - ] - PROBABLE_TOOLCHAIN_DEPENDENCIES = [ - ("GMP", "gmp-version"), - ("MPC", "mpc-version"), - ("MPFR", "mpfr-version") - ] - WINDOWS_TOOLCHAIN_DEPENDENCIES = [ - ("MAKEFILE", "make-version") - ] - CHANGELOG_TEXT = "Uses toolchain dependencies:\r\n" - for name, version in BASE_TOOLCHAIN_DEPENDENCIES: - CHANGELOG_TEXT += f" * {name}: V{needs.build-toolchain.outputs[version]}\r\n" - CHANGELOG_TEXT += "Uses probable extra dependencies:\r\n" - for name, version in PROBABLE_TOOLCHAIN_DEPENDENCIES: - CHANGELOG_TEXT += f" * {name}: V{needs.build-toolchain.outputs[version]}\r\n" + CHANGELOG_TEXT="Uses toolchain dependencies:\r\n" + CHANGELOG_TEXT+=" * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" + CHANGELOG_TEXT+=" * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" + CHANGELOG_TEXT+=" * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" + CHANGELOG_TEXT+="Uses probable extra dependencies:\r\n" + CHANGELOG_TEXT+=" * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" + CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" + CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" + CHANGELOG_TEXT += "Uses Windows dependencies:\r\n" + CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG # Compress and move the windows folder ready for upload. - - name: Compress and move windows artifacts to $GITHUB_WORKSPACE/win64 + - name: Compress and move windows artifacts run: | cd ${{ steps.download-windows-artifact.outputs.download-path }} zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-win64.zip * From b7df223072baf2e18fee9afb2e3c3c89ae17e69d Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Tue, 3 Jan 2023 16:59:25 +0000 Subject: [PATCH 41/55] Include makefile in build for windows. --- .github/workflows/build-toolchain.yml | 65 ++++++++++++++++----------- INSTALLATION.md | 5 ++- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index f2029b3..7944989 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -22,13 +22,13 @@ jobs: gmp-version: ${{ steps.gcc-version-generator.outputs.GMP_VERSION }} mpc-version: ${{ steps.gcc-version-generator.outputs.MPC_VERSION }} mpfr-version: ${{ steps.gcc-version-generator.outputs.MPFR_VERSION }} -# make-version: ${{ steps.gcc-version-generator.outputs.MAKE_VERSION }} + make-version: ${{ steps.gcc-version-generator.outputs.MAKE_VERSION }} strategy: fail-fast: false matrix: include: [ - { target-platform: Windows-x86_64, host: x86_64-w64-mingw32 }, - { target-platform: Linux-x86_64, host: '' } + { target-platform: Windows-x86_64, host: x86_64-w64-mingw32, makefile-version: 4.4 }, + { target-platform: Linux-x86_64, host: '', makefile-version: '' } ] steps: @@ -53,6 +53,7 @@ jobs: with: bundler-cache: true ruby-version: '3.1' + continue-on-error: true - name: Install Package Creator if: ${{ matrix.target-platform == 'Linux-x86_64' }} @@ -88,7 +89,8 @@ jobs: echo "GMP_VERSION=$(grep -Po 'GMP_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT echo "MPC_VERSION=$(grep -Po 'MPC_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT echo "MPFR_VERSION=$(grep -Po 'MPFR_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT - # echo "MAKE_VERSION=$(grep -Po 'MAKE_V=\K[^"]*' ./tools/build-toolchain.sh)" >> $GITHUB_OUTPUT + # TODO: this version is set explicitly. We need to fix! + echo "MAKE_VERSION=4.4" >> $GITHUB_OUTPUT continue-on-error: false - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} @@ -96,7 +98,7 @@ jobs: # required for newlib (as not the default?!) export PATH="$PATH:${{ runner.temp }}/n64-brew" cd ./tools/ - sudo N64_INST=${{ runner.temp }}/n64-brew HOST=${{ matrix.host }} ./build-toolchain.sh + sudo N64_INST=${{ runner.temp }}/n64-brew HOST=${{ matrix.host }} MAKE_V=${{ matrix.makefile-version }} ./build-toolchain.sh continue-on-error: true # https://fpm.readthedocs.io/en/v1.15.0/getting-started.html @@ -167,13 +169,17 @@ jobs: needs: build-toolchain steps: - - name: Download artifact + - uses: actions/checkout@v3 + + - name: Download Windows artifact + id: download-windows-artifact uses: actions/download-artifact@v3 with: name: gcc-toolchain-mips64-Windows-x86_64 path: ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64 - - name: Download artifact + - name: Download Linux artifact + id: download-linux-artifact uses: actions/download-artifact@v3 with: name: gcc-toolchain-mips64-Linux-x86_64 @@ -181,34 +187,39 @@ jobs: - name: Generate Changelog run: | - $CHANGELOG_TEXT = "Uses toolchain dependencies:\r\n" - $CHANGELOG_TEXT += " * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" - $CHANGELOG_TEXT += " * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" - $CHANGELOG_TEXT += " * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" - $CHANGELOG_TEXT += " * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" - $CHANGELOG_TEXT += " * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" - $CHANGELOG_TEXT += " * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" - # $CHANGELOG_TEXT += " * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" - echo $CHANGELOG_TEXT > ${{ github.workspace }}/CHANGELOG.txt - - - name: Compress Windows-x86_64 Artifacts + CHANGELOG_TEXT="Uses toolchain dependencies:\r\n" + CHANGELOG_TEXT+=" * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" + CHANGELOG_TEXT+=" * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" + CHANGELOG_TEXT+=" * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" + CHANGELOG_TEXT+="Uses probable extra dependencies:\r\n" + CHANGELOG_TEXT+=" * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" + CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" + CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" + CHANGELOG_TEXT += "Uses Windows dependencies:\r\n" + CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" + echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG + + # Compress and move the windows folder ready for upload. + - name: Compress and move windows artifacts run: | - cd ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64 - zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-Windows-x86_64.zip * - continue-on-error: true + cd ${{ steps.download-windows-artifact.outputs.download-path }} + zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-win64.zip * +# TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. +# TODO: INSTALLATION.md should this be markdown or converted to text (it is readable anyway). - name: Generate Draft Pre-Release -# if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') + # if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v1 with: draft: true prerelease: true - body_path: CHANGELOG.txt - name: "V${{ needs.build-toolchain.outputs.gcc-version }}-latest # ${{ github.run_id }}" # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. - # tag_name: "latest" # uses GH run id as default, using latest causes issues as it tries to create a tag that already exists. + body_path: CHANGELOG + generate_release_notes: false + name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-latest-prerelease' + tag_name: "toolchain-latest-prerelease" files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm - ${{ runner.temp }}/**/*.zip + ${{ runner.temp }}/*.zip LICENSE - INSTALLATION.md # TODO: should this be markdown or converted to text (it is readable anyway). + INSTALLATION.md diff --git a/INSTALLATION.md b/INSTALLATION.md index c775c40..1444758 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -10,4 +10,7 @@ .rpm ## Windows -.zip +Download the .zip file and extract it. +Move the contained file. +Add the file path to an environment variable +Enjoy! From 34df3c09cdac17eeb1df58fdc04ea85a3c3a2e7c Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Fri, 6 Jan 2023 01:23:14 +0000 Subject: [PATCH 42/55] Fix spacing error. --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 7944989..bc920fe 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -195,7 +195,7 @@ jobs: CHANGELOG_TEXT+=" * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" - CHANGELOG_TEXT += "Uses Windows dependencies:\r\n" + CHANGELOG_TEXT+="Uses Windows dependencies:\r\n" CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG From 464ac6570095a7750ac47433e593d734a371f11c Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Fri, 6 Jan 2023 02:53:39 +0000 Subject: [PATCH 43/55] Test changlog CRLF --- .github/workflows/build-toolchain.yml | 29 ++++++++++++++++++--------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index bc920fe..d544cdb 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -187,16 +187,16 @@ jobs: - name: Generate Changelog run: | - CHANGELOG_TEXT="Uses toolchain dependencies:\r\n" - CHANGELOG_TEXT+=" * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n" - CHANGELOG_TEXT+=" * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n" - CHANGELOG_TEXT+=" * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n" - CHANGELOG_TEXT+="Uses probable extra dependencies:\r\n" - CHANGELOG_TEXT+=" * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n" - CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n" - CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n" - CHANGELOG_TEXT+="Uses Windows dependencies:\r\n" - CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n" + CHANGELOG_TEXT='Uses toolchain dependencies:\r\n' + CHANGELOG_TEXT+=' * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n' + CHANGELOG_TEXT+=' * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n' + CHANGELOG_TEXT+=' * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n' + CHANGELOG_TEXT+='Uses probable extra dependencies:\r\n' + CHANGELOG_TEXT+=' * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n' + CHANGELOG_TEXT+=' * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n' + CHANGELOG_TEXT+=' * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n' + CHANGELOG_TEXT+='Uses Windows dependencies:\r\n' + CHANGELOG_TEXT+=' * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n' echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG # Compress and move the windows folder ready for upload. @@ -205,6 +205,15 @@ jobs: cd ${{ steps.download-windows-artifact.outputs.download-path }} zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-win64.zip * +#FIXME: updating a draft is a known issue: https://github.com/softprops/action-gh-release/pull/245 +# for the moment, we are just going to delete them to re-add in the next step! + - name: Delete drafts + uses: hugo19941994/delete-draft-releases@v1 + with: + threshold: 5y + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. # TODO: INSTALLATION.md should this be markdown or converted to text (it is readable anyway). - name: Generate Draft Pre-Release From 3b2f1199893c9dfd761fa249ca2cd91c043c0c46 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 7 Jan 2023 17:24:55 +0000 Subject: [PATCH 44/55] Update changelog to use html line breaks --- .github/workflows/build-toolchain.yml | 29 +++++++++------------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index d544cdb..e7e0e64 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -187,16 +187,16 @@ jobs: - name: Generate Changelog run: | - CHANGELOG_TEXT='Uses toolchain dependencies:\r\n' - CHANGELOG_TEXT+=' * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}\r\n' - CHANGELOG_TEXT+=' * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}\r\n' - CHANGELOG_TEXT+=' * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}\r\n' - CHANGELOG_TEXT+='Uses probable extra dependencies:\r\n' - CHANGELOG_TEXT+=' * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}\r\n' - CHANGELOG_TEXT+=' * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}\r\n' - CHANGELOG_TEXT+=' * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}\r\n' - CHANGELOG_TEXT+='Uses Windows dependencies:\r\n' - CHANGELOG_TEXT+=' * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}\r\n' + CHANGELOG_TEXT="Uses toolchain dependencies:
" + CHANGELOG_TEXT+=" * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}
" + CHANGELOG_TEXT+=" * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}
" + CHANGELOG_TEXT+=" * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}
" + CHANGELOG_TEXT+="Uses probable extra dependencies:
" + CHANGELOG_TEXT+=" * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}
" + CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}
" + CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}
" + CHANGELOG_TEXT+="Uses Windows dependencies:
" + CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}
" echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG # Compress and move the windows folder ready for upload. @@ -205,15 +205,6 @@ jobs: cd ${{ steps.download-windows-artifact.outputs.download-path }} zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-win64.zip * -#FIXME: updating a draft is a known issue: https://github.com/softprops/action-gh-release/pull/245 -# for the moment, we are just going to delete them to re-add in the next step! - - name: Delete drafts - uses: hugo19941994/delete-draft-releases@v1 - with: - threshold: 5y - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. # TODO: INSTALLATION.md should this be markdown or converted to text (it is readable anyway). - name: Generate Draft Pre-Release From 7d05f084e424f9e410f640d8ca88936e547cf104 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 7 Jan 2023 19:19:31 +0000 Subject: [PATCH 45/55] Final fixups. --- .github/workflows/build-toolchain.yml | 22 ++++- .github/workflows/build-toolchain.yml.bak | 111 ---------------------- INSTALLATION.md | 8 +- 3 files changed, 22 insertions(+), 119 deletions(-) delete mode 100644 .github/workflows/build-toolchain.yml.bak diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index e7e0e64..3b5d3a3 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -185,18 +185,30 @@ jobs: name: gcc-toolchain-mips64-Linux-x86_64 path: ${{ runner.temp }}/gcc-toolchain-mips64-Linux-x86_64 + - name: Convert files for release upload + run: | + mv ${{ github.workspace }}/LICENSE ${{ github.workspace }}/LICENSE.txt + mv ${{ github.workspace }}/INSTALLATION.md ${{ github.workspace }}/INSTALLATION.txt + - name: Generate Changelog run: | - CHANGELOG_TEXT="Uses toolchain dependencies:
" + CHANGELOG_TEXT="Latest GCC toolchain for the N64
" + CHANGELOG_TEXT+="Generated from libDragon.
" + CHANGELOG_TEXT+='
' + CHANGELOG_TEXT+='
' + CHANGELOG_TEXT+="Builds toolchain dependencies:
" CHANGELOG_TEXT+=" * GCC: V${{ needs.build-toolchain.outputs.gcc-version }}
" CHANGELOG_TEXT+=" * Newlib: V${{ needs.build-toolchain.outputs.newlib-version }}
" CHANGELOG_TEXT+=" * BinUtils: V${{ needs.build-toolchain.outputs.binutils-version }}
" - CHANGELOG_TEXT+="Uses probable extra dependencies:
" + CHANGELOG_TEXT+='
' + CHANGELOG_TEXT+="With dependencies:
" CHANGELOG_TEXT+=" * GMP: V${{ needs.build-toolchain.outputs.gmp-version }}
" CHANGELOG_TEXT+=" * MPC: V${{ needs.build-toolchain.outputs.mpc-version }}
" CHANGELOG_TEXT+=" * MPFR: V${{ needs.build-toolchain.outputs.mpfr-version }}
" - CHANGELOG_TEXT+="Uses Windows dependencies:
" + CHANGELOG_TEXT+='
' + CHANGELOG_TEXT+="Also generates Windows toolchain dependencies:
" CHANGELOG_TEXT+=" * MAKEFILE: V${{ needs.build-toolchain.outputs.make-version }}
" + CHANGELOG_TEXT+='
' echo "$CHANGELOG_TEXT" > ${{ github.workspace }}/CHANGELOG # Compress and move the windows folder ready for upload. @@ -221,5 +233,5 @@ jobs: ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm ${{ runner.temp }}/*.zip - LICENSE - INSTALLATION.md + LICENSE.txt + INSTALLATION.txt diff --git a/.github/workflows/build-toolchain.yml.bak b/.github/workflows/build-toolchain.yml.bak deleted file mode 100644 index 41216f0..0000000 --- a/.github/workflows/build-toolchain.yml.bak +++ /dev/null @@ -1,111 +0,0 @@ -name: CI - -on: - push: - pull_request: - branches: - - '!develop**' # excludes develop* branches (reserved to not duplicate builds that are not on forks) - # repository_dispatch: - # types: [run_build] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - # # Depending on Ubuntu version, maybe required for GCC install. - # - name: Add GCC Repository - # run: | - # sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y - # sudo apt-get -qq update - - # Some of these packages may already be installed, but update just incase (it doesn't hurt)! - - name: Install Required Packages - run: | - sudo apt-get install -y build-essential software-properties-common - # sudo apt-get install -y gcc-10 - # sudo apt-get install -y g++-10 - sudo apt-get install -y mingw-w64 - # sudo apt-get install -y libgmp-dev bison - sudo apt-get install -y libmpfr-dev libmpc-dev - sudo apt-get install -y byacc texinfo - sudo apt-get install -y zip gzip tar - # sudo apt-gey install -y gcc-9-locales wine wine64 # not actually required, but suggested by the CI - - # # Generate a changelog (not currently that helpful (and not required for local builds)). - # - name: Create Changelog - # run: | - # touch "CHANGELOG.txt" - # git log --oneline --decorate > CHANGELOG.txt - - # We do it first to fail fast (as most unknown)! - # Build MakeFile against linux (for windows) - - name: Build win64 makefile executable - run: | - cd $GITHUB_WORKSPACE/scripts/build/win64 - bash ./build-win64-makefile.sh - rm ./build-win64-makefile.sh - - # Build the mips64 GCC toolchain against linux - - name: Build linux64 toolchain - run: | - cd $GITHUB_WORKSPACE/scripts/build/linux64 - bash ./build-linux64-toolchain.sh - rm ./build-linux64-toolchain.sh - - # Compress and move the linux folder ready for upload (not needed for local builds). - - name: Compress and move linux artifact to $GITHUB_WORKSPACE/linux64 - if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') - run: | - mkdir -p $GITHUB_WORKSPACE/linux64/ - cd $GITHUB_WORKSPACE/scripts/build/linux64 - tar -czf ../gcc-toolchain-mips64-linux64.tar.gz * - mv "$GITHUB_WORKSPACE/scripts/build/gcc-toolchain-mips64-linux64.tar.gz" "$GITHUB_WORKSPACE/linux64/" - - # # Publish the compressed linux folder to the to github Artifacts (not needed unless debugging (adds considerable time)). - # - name: Publish linux Build Artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: gcc-toolchain-mips64-linux64 - # path: ${{ github.workspace }}/scripts/build/linux64/* - # retention-days: 5 - - # Build the GCC toolchain against linux (for windows) and compress it (local builds could run build.sh). - - name: Build win64 toolchain - run: | - cd $GITHUB_WORKSPACE/scripts/build/win64 - bash ./build-win64-toolchain.sh - rm ./build-win64-toolchain.sh - - # Compress and move the windows folder ready for upload (not needed for local builds). - - name: Compress and move windows artifacts to $GITHUB_WORKSPACE/win64 - if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') - run: | - mkdir -p $GITHUB_WORKSPACE/win64/ - cd $GITHUB_WORKSPACE/scripts/build/win64 - zip -r -q $GITHUB_WORKSPACE/scripts/build/gcc-toolchain-mips64-win64.zip * - mv "$GITHUB_WORKSPACE/scripts/build/gcc-toolchain-mips64-win64.zip" "$GITHUB_WORKSPACE/win64/" - - # Publish windows build artifacts to github Artifacts (not needed for local builds). - - name: Publish windows Build Artifacts - uses: actions/upload-artifact@v3 - with: - name: gcc-toolchain-mips64-win64 - path: ${{ github.workspace }}/scripts/build/win64/* - - - name: Generate Draft Release - if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 - with: - draft: true - prerelease: true - name: "Vx.x.x-y" - #tag_name: "latest" - files: | - linux64/gcc-toolchain-mips64-linux64.tar.gz - win64/gcc-toolchain-mips64-win64.zip - # CHANGELOG.txt diff --git a/INSTALLATION.md b/INSTALLATION.md index 1444758..15b594a 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -4,10 +4,12 @@ ## Debian -.deb +Download and install the debian (.deb) package: +`$ sudo dpkg -i .deb` -## Redhat -.rpm +## RPM +Download and install the RPM (.rpm) package. +`rpm -i .rpm` ## Windows Download the .zip file and extract it. From 10c08733779090c5d2cdc276fd45430aa38b8b6d Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 7 Jan 2023 21:11:52 +0000 Subject: [PATCH 46/55] Add package environment variable generation. --- .github/workflows/build-toolchain.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 3b5d3a3..5a7260f 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -102,9 +102,14 @@ jobs: continue-on-error: true # https://fpm.readthedocs.io/en/v1.15.0/getting-started.html - - name: Generate toolchain packages for UNIX based OS + - name: Generate toolchain packages for Linux based OS if: ${{ matrix.target-platform == 'Linux-x86_64' }} run: | + echo Generate environment var file + echo 'export N64_INST=/opt/n64' > "libdragon-env.sh" + chmod 755 "libdragon-env.sh" + + #TODO: there is currently a dependency on bash, but this should actually be makefile. echo Generating debian package fpm \ -t deb \ @@ -118,7 +123,8 @@ jobs: --description "$Package_Description" \ --url "$Package_Url" \ --maintainer "$Package_Maintainer" \ - ${{ runner.temp }}/n64-brew/=/usr/local/ + ${{ runner.temp }}/n64-brew/=/opt/n64/ + libdragon-env.sh=/etc/profile.d/libdragon-env.sh echo Generating rpm package fpm \ @@ -129,11 +135,12 @@ jobs: --license $Package_License \ --version $Package_Version \ --architecture x86_64 \ - --depends nginx \ + --depends bash \ --description "$Package_Description" \ --url "$Package_Url" \ --maintainer "$Package_Maintainer" \ - ${{ runner.temp }}/n64-brew/=/usr/local/ + ${{ runner.temp }}/n64-brew/=/opt/n64/ + libdragon-env.sh=/etc/profile.d/libdragon-env.sh continue-on-error: true env: Package_Name: gcc-toolchain-mips64-linux64 From feb734df2e59041089838b990f8713a7339e53a4 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 7 Jan 2023 21:45:58 +0000 Subject: [PATCH 47/55] Fix command --- .github/workflows/build-toolchain.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 5a7260f..367247f 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -123,7 +123,7 @@ jobs: --description "$Package_Description" \ --url "$Package_Url" \ --maintainer "$Package_Maintainer" \ - ${{ runner.temp }}/n64-brew/=/opt/n64/ + ${{ runner.temp }}/n64-brew/=/opt/n64/ \ libdragon-env.sh=/etc/profile.d/libdragon-env.sh echo Generating rpm package @@ -139,7 +139,7 @@ jobs: --description "$Package_Description" \ --url "$Package_Url" \ --maintainer "$Package_Maintainer" \ - ${{ runner.temp }}/n64-brew/=/opt/n64/ + ${{ runner.temp }}/n64-brew/=/opt/n64/ \ libdragon-env.sh=/etc/profile.d/libdragon-env.sh continue-on-error: true env: From 2db89cf0d0463fa3f74603552e0fccb5ac7091da Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 7 Jan 2023 22:59:49 +0000 Subject: [PATCH 48/55] Improve step variables. --- .github/workflows/build-toolchain.yml | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 367247f..a1c2a10 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -31,6 +31,9 @@ jobs: { target-platform: Linux-x86_64, host: '', makefile-version: '' } ] + env: + Build_Directory: ${{ runner.temp }}/libdragon-toolchain + steps: - name: Install native system build dependencies run: | @@ -96,9 +99,9 @@ jobs: - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} run: | # required for newlib (as not the default?!) - export PATH="$PATH:${{ runner.temp }}/n64-brew" + export PATH="$PATH:${{ env.Build_Directory }}" cd ./tools/ - sudo N64_INST=${{ runner.temp }}/n64-brew HOST=${{ matrix.host }} MAKE_V=${{ matrix.makefile-version }} ./build-toolchain.sh + sudo N64_INST=${{ env.Build_Directory }} HOST=${{ matrix.host }} MAKE_V=${{ matrix.makefile-version }} ./build-toolchain.sh continue-on-error: true # https://fpm.readthedocs.io/en/v1.15.0/getting-started.html @@ -106,8 +109,8 @@ jobs: if: ${{ matrix.target-platform == 'Linux-x86_64' }} run: | echo Generate environment var file - echo 'export N64_INST=/opt/n64' > "libdragon-env.sh" - chmod 755 "libdragon-env.sh" + echo 'export N64_INST=$Package_Installation_Directory' > "$Package_Name-env.sh" + chmod 755 "$Package_Name-env.sh" #TODO: there is currently a dependency on bash, but this should actually be makefile. echo Generating debian package @@ -123,8 +126,8 @@ jobs: --description "$Package_Description" \ --url "$Package_Url" \ --maintainer "$Package_Maintainer" \ - ${{ runner.temp }}/n64-brew/=/opt/n64/ \ - libdragon-env.sh=/etc/profile.d/libdragon-env.sh + $Package_Source_Directory=$Package_Installation_Directory/ \ + $Package_Name-env.sh=/etc/profile.d/$Package_Name-env.sh echo Generating rpm package fpm \ @@ -139,10 +142,12 @@ jobs: --description "$Package_Description" \ --url "$Package_Url" \ --maintainer "$Package_Maintainer" \ - ${{ runner.temp }}/n64-brew/=/opt/n64/ \ - libdragon-env.sh=/etc/profile.d/libdragon-env.sh + $Package_Source_Directory=$Package_Installation_Directory/ \ + $Package_Name-env.sh=/etc/profile.d/$Package_Name-env.sh continue-on-error: true env: + Package_Source_Directory: ${{ env.Build_Directory }}/ + Package_Installation_Directory: /opt/n64 Package_Name: gcc-toolchain-mips64-linux64 Package_Version: ${{ steps.gcc-version-generator.outputs.GCC_VERSION }} Package_Revision: ${{ github.run_id }} @@ -157,7 +162,7 @@ jobs: with: name: gcc-toolchain-mips64-${{ matrix.target-platform }} path: | - ${{ runner.temp }}/n64-brew + ${{ env.Build_Directory }} continue-on-error: true - name: Publish Linux-x86_64 Build Artifacts From 56d73abac0fff66abd206c5f263e6bfb8263498a Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sat, 7 Jan 2023 23:12:44 +0000 Subject: [PATCH 49/55] Fix CI environment variable --- .github/workflows/build-toolchain.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index a1c2a10..5443eb9 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -32,7 +32,7 @@ jobs: ] env: - Build_Directory: ${{ runner.temp }}/libdragon-toolchain + Build_Directory: libdragon-toolchain steps: - name: Install native system build dependencies @@ -99,9 +99,9 @@ jobs: - name: Build N64 MIPS GCC toolchain for ${{ matrix.target-platform }} run: | # required for newlib (as not the default?!) - export PATH="$PATH:${{ env.Build_Directory }}" + export PATH="$PATH:${{ runner.temp }}/${{ env.Build_Directory }}" cd ./tools/ - sudo N64_INST=${{ env.Build_Directory }} HOST=${{ matrix.host }} MAKE_V=${{ matrix.makefile-version }} ./build-toolchain.sh + sudo N64_INST=${{ runner.temp }}/${{ env.Build_Directory }} HOST=${{ matrix.host }} MAKE_V=${{ matrix.makefile-version }} ./build-toolchain.sh continue-on-error: true # https://fpm.readthedocs.io/en/v1.15.0/getting-started.html @@ -146,7 +146,7 @@ jobs: $Package_Name-env.sh=/etc/profile.d/$Package_Name-env.sh continue-on-error: true env: - Package_Source_Directory: ${{ env.Build_Directory }}/ + Package_Source_Directory: ${{ runner.temp }}/${{ env.Build_Directory }}/ Package_Installation_Directory: /opt/n64 Package_Name: gcc-toolchain-mips64-linux64 Package_Version: ${{ steps.gcc-version-generator.outputs.GCC_VERSION }} @@ -162,7 +162,7 @@ jobs: with: name: gcc-toolchain-mips64-${{ matrix.target-platform }} path: | - ${{ env.Build_Directory }} + ${{ runner.temp }}/${{ env.Build_Directory }} continue-on-error: true - name: Publish Linux-x86_64 Build Artifacts From 5e562b0fda4fc9eb84634ecd507f3bd86012832c Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 8 Jan 2023 00:23:06 +0000 Subject: [PATCH 50/55] Minor improvements. --- .github/workflows/build-toolchain.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 5443eb9..0b93eca 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -42,6 +42,7 @@ jobs: sudo apt-get install libmpc-dev sudo apt-get install squashfs-tools # If there are other dependencies, we should add them here and make sure the documentation is updated! + continue-on-error: true - name: Install x-compile system build dependencies if: ${{ matrix.target-platform == 'Windows-x86_64' }} @@ -112,7 +113,9 @@ jobs: echo 'export N64_INST=$Package_Installation_Directory' > "$Package_Name-env.sh" chmod 755 "$Package_Name-env.sh" - #TODO: there is currently a dependency on bash, but this should actually be makefile. + # TODO: there is currently a dependency on makefile. but it is not added. + # packages need something like `--depends bash \` + # TODO: a warning is generated when adding files to `\etc`. The current workaround is: --deb-no-default-config-files echo Generating debian package fpm \ -t deb \ @@ -122,10 +125,10 @@ jobs: --license $Package_License \ --version $Package_Version \ --architecture all \ - --depends bash \ --description "$Package_Description" \ --url "$Package_Url" \ --maintainer "$Package_Maintainer" \ + --deb-no-default-config-files \ $Package_Source_Directory=$Package_Installation_Directory/ \ $Package_Name-env.sh=/etc/profile.d/$Package_Name-env.sh @@ -138,7 +141,6 @@ jobs: --license $Package_License \ --version $Package_Version \ --architecture x86_64 \ - --depends bash \ --description "$Package_Description" \ --url "$Package_Url" \ --maintainer "$Package_Maintainer" \ From cd0d2d9b19d91e00d1540ce2a4bd1b7f8bba3c17 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 8 Jan 2023 00:52:54 +0000 Subject: [PATCH 51/55] Generate releases based on branch. --- .github/workflows/build-toolchain.yml | 24 ++++++++++++++++++++---- INSTALLATION.md | 8 ++++---- README.md | 6 +++--- 3 files changed, 27 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 0b93eca..fbe1877 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -232,17 +232,33 @@ jobs: zip -r -q ${{ runner.temp }}/gcc-toolchain-mips64-win64.zip * # TODO: name and tag... ${{ github.run_id }} # TODO: ideally we would just overwrite the run id (nightly build) until ready for release. -# TODO: INSTALLATION.md should this be markdown or converted to text (it is readable anyway). + - name: Generate Release + if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + draft: false + prerelease: false + body_path: CHANGELOG + generate_release_notes: false + name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-latest' + tag_name: "latest" + files: | + ${{ runner.temp }}/**/*.deb + ${{ runner.temp }}/**/*.rpm + ${{ runner.temp }}/*.zip + LICENSE.txt + INSTALLATION.txt + - name: Generate Draft Pre-Release - # if: startsWith(github.ref, 'refs/heads/master') # Actually, should we only do it on a tag?! if: startsWith(github.ref, 'refs/tags/') + if: github.event_name != 'pull_request' uses: softprops/action-gh-release@v1 with: draft: true prerelease: true body_path: CHANGELOG generate_release_notes: false - name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-latest-prerelease' - tag_name: "toolchain-latest-prerelease" + name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-${{ github.run_id }}' + tag_name: "toolchain-continuous-prerelease" files: | ${{ runner.temp }}/**/*.deb ${{ runner.temp }}/**/*.rpm diff --git a/INSTALLATION.md b/INSTALLATION.md index 15b594a..90153a7 100644 --- a/INSTALLATION.md +++ b/INSTALLATION.md @@ -3,16 +3,16 @@ ## Operating System -## Debian +### Debian Download and install the debian (.deb) package: `$ sudo dpkg -i .deb` -## RPM +### RPM Download and install the RPM (.rpm) package. `rpm -i .rpm` -## Windows +### Windows Download the .zip file and extract it. -Move the contained file. +Move the folder. Add the file path to an environment variable Enjoy! diff --git a/README.md b/README.md index b5d1670..d95de7f 100644 --- a/README.md +++ b/README.md @@ -9,12 +9,12 @@ sudo N64_INST=/usr/local/n64/ HOST=x86_64-w64-mingw32 ./build-toolchain.sh # mips64-gcc-toolchain for the N64 This repo automatically generates the MIPS64 GCC toolchain to allow cross compilation for the N64. -The binaries can be downloaded (from releases) and used as part of other build scripts/components which saves time (at least 30 minutes) when setting up a developer environment in order to build N64 libraries such as libdragon in a `Windows` environment. +The binaries can be downloaded (from releases) and used as part of other build scripts/components which saves time (at least 30 minutes) when setting up a developer environment in order to build N64 libraries such as libdragon in a `Windows` environment (without using docker). [![Github Action CI](https://github.com/n64-tools/mips64-gcc-toolchain/actions/workflows/build-toolchain.yml/badge.svg)](https://github.com/n64-tools/mips64-gcc-toolchain/actions/workflows/build-toolchain.yml) Architecture | Download Links --- | --- Windows x86_x64 | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-win64.zip) -Debian | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64.deb) -Redhat | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64.rpm) +Debian | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-linux64.deb) +Redhat | [Latest](https://github.com/n64-tools/mips64-gcc-toolchain/releases/latest/download/gcc-toolchain-mips64-linux64.rpm) From e5b7e6e1979f223ce25981ad8789789d4cace0d8 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 8 Jan 2023 01:30:24 +0000 Subject: [PATCH 52/55] Fix binutils variable version. --- .github/workflows/build-toolchain.yml | 2 +- README.md | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index fbe1877..55ffa23 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -18,7 +18,7 @@ jobs: outputs: gcc-version: ${{ steps.gcc-version-generator.outputs.GCC_VERSION }} newlib-version: ${{ steps.gcc-version-generator.outputs.NEWLIB_VERSION }} - binutils-version: ${{ steps.gcc-version-generator.outputs.NEWLIB_VERSION }} + binutils-version: ${{ steps.gcc-version-generator.outputs.BINUTILS_VERSION }} gmp-version: ${{ steps.gcc-version-generator.outputs.GMP_VERSION }} mpc-version: ${{ steps.gcc-version-generator.outputs.MPC_VERSION }} mpfr-version: ${{ steps.gcc-version-generator.outputs.MPFR_VERSION }} diff --git a/README.md b/README.md index d95de7f..b39902b 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,4 @@ -**NOTE:** This repo will be updated or deprecated in the near future as the [official libDragon](dragonminded/libgragon) toolchain now supports the ability to do the same thing using: -``` -sudo apt-get install -y mingw-w64 -cd ./tools/ -sudo N64_INST=/usr/local/n64/ HOST=x86_64-w64-mingw32 ./build-toolchain.sh -``` - +**NOTE:** This repo uses the [official libDragon](dragonminded/libdragon) toolchain build script to generate its artifacts. However, it may also include features or abilities that have not yet been added. # mips64-gcc-toolchain for the N64 From f543314282fa8bdcb23250a3ee0f438e9bd4b734 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Sun, 8 Jan 2023 02:49:27 +0000 Subject: [PATCH 53/55] Improve size by removing un-necessary files Improve package name Add sample dockerfile Add sample CI for dockerfile --- .github/workflows/build-docker.yml.bak | 43 +++++++++++++++++ .github/workflows/build-toolchain.yml | 17 ++++--- Dockerfile | 67 ++++++++++++++++++++++++++ 3 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/build-docker.yml.bak create mode 100644 Dockerfile diff --git a/.github/workflows/build-docker.yml.bak b/.github/workflows/build-docker.yml.bak new file mode 100644 index 0000000..c33a8df --- /dev/null +++ b/.github/workflows/build-docker.yml.bak @@ -0,0 +1,43 @@ +# Copyright (c) NetworkFusion 2023 +# See LICENSE file in the project root for full license information. + +name: Build Docker Container + +env: + GCR_FILE: Dockerfile + +on: + push: + branches: + - master + paths: + - '**Dockerfile' + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + # username: ${{ github.repository_owner }} + # password: ${{ secrets.CONTAINER_BUILD_TOKEN }} + + - name: Build and Push Docker Image + uses: docker/build-push-action@v3 + with: + file: ${{ env.GCR_FILE }} + push: true # Will only build if this is not here + tags: | + # ${{ env.GCR_IMAGE }}:${{ env.GCR_VERSION }} + ${{ env.GCR_IMAGE }}:latest \ No newline at end of file diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 55ffa23..b2820b7 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -32,7 +32,7 @@ jobs: ] env: - Build_Directory: libdragon-toolchain + Build_Directory: gcc-toolchain-mips64 steps: - name: Install native system build dependencies @@ -103,6 +103,9 @@ jobs: export PATH="$PATH:${{ runner.temp }}/${{ env.Build_Directory }}" cd ./tools/ sudo N64_INST=${{ runner.temp }}/${{ env.Build_Directory }} HOST=${{ matrix.host }} MAKE_V=${{ matrix.makefile-version }} ./build-toolchain.sh + + echo Remove un-necessary content + rm -rf ${N64_INST}/share/locale/* continue-on-error: true # https://fpm.readthedocs.io/en/v1.15.0/getting-started.html @@ -115,8 +118,8 @@ jobs: # TODO: there is currently a dependency on makefile. but it is not added. # packages need something like `--depends bash \` - # TODO: a warning is generated when adding files to `\etc`. The current workaround is: --deb-no-default-config-files echo Generating debian package + # TODO: a warning is generated when adding files to `\etc`. The current workaround is: --deb-no-default-config-files fpm \ -t deb \ -s dir \ @@ -149,14 +152,14 @@ jobs: continue-on-error: true env: Package_Source_Directory: ${{ runner.temp }}/${{ env.Build_Directory }}/ - Package_Installation_Directory: /opt/n64 - Package_Name: gcc-toolchain-mips64-linux64 + Package_Installation_Directory: /opt/${{ env.Build_Directory }}-n64tools + Package_Name: ${{ env.Build_Directory }}-n64tools Package_Version: ${{ steps.gcc-version-generator.outputs.GCC_VERSION }} Package_Revision: ${{ github.run_id }} Package_License: GPL Package_Description: MIPS GCC toolchain for the N64 - Package_Url: https://n64brew.com - Package_Maintainer: N64 Brew Community + Package_Url: https://github.com/n64-tools/ + Package_Maintainer: N64-Tool Contributers - name: Publish Windows-x86_64 Build Artifact if: ${{ matrix.target-platform == 'Windows-x86_64' }} @@ -240,7 +243,7 @@ jobs: prerelease: false body_path: CHANGELOG generate_release_notes: false - name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-latest' + name: 'V${{ needs.build-toolchain.outputs.gcc-version }}-${{ github.run_id }}' tag_name: "latest" files: | ${{ runner.temp }}/**/*.deb diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fe8b728 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,67 @@ +# syntax=docker/dockerfile:1 +# V0 - Use this comment to force a re-build without changing the contents + +# Stage 1 - Build the toolchain +FROM debian:stable-slim AS toolchain-builder +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive + +# Install required dependencies +RUN apt-get update \ + && apt-get -y install --no-install-recommends apt-utils \ + && apt-get install -y \ + curl \ + bzip2 \ + make \ + file \ + libmpfr-dev \ + libmpc-dev \ + zlib1g-dev \ + texinfo \ + git \ + gcc \ + g++ + +ARG N64_INST=/n64_toolchain +ENV N64_INST=${N64_INST} + +# Build +COPY ./tools/build-toolchain.sh /tmp/tools/build-toolchain.sh +WORKDIR /tmp/tools +RUN ./build-toolchain.sh + +# Remove locale strings which are not so important in our use case +RUN rm -rf ${N64_INST}/share/locale/* + +# Stage 2 - Prepare minimal image +FROM debian:11.1-slim +# Avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive +# Setup paths for the libgragon toolchain +ARG N64_INST=/n64_toolchain +ENV N64_INST=${N64_INST} +ENV PATH="${N64_INST}/bin:$PATH" + +# Install dependencies for building libdragon tools and ROMS (using makefiles and CMake) +# and (commented out) ability to use it as a vs-code devcontainer. +RUN apt-get update && \ + apt-get -y install --no-install-recommends apt-utils dialog icu-devtools 2>&1 &&\ + apt-get install -yq \ + gcc \ + g++ \ + make \ + libpng-dev \ + git \ + curl \ + cmake \ + ninja-build + +COPY --from=toolchain-builder ${N64_INST} ${N64_INST} + +# Clean up downloaded files +RUN apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* + +# Switch back to dialog for any ad-hoc use of apt-get +ENV DEBIAN_FRONTEND=dialog From 28e0ce6b4fbedbe84984991471db2a04eb64da19 Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Fri, 13 Jan 2023 20:37:20 +0000 Subject: [PATCH 54/55] Enable dockerfile build and release. --- .github/workflows/{build-docker.yml.bak => build-docker.yml} | 0 Dockerfile | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{build-docker.yml.bak => build-docker.yml} (100%) diff --git a/.github/workflows/build-docker.yml.bak b/.github/workflows/build-docker.yml similarity index 100% rename from .github/workflows/build-docker.yml.bak rename to .github/workflows/build-docker.yml diff --git a/Dockerfile b/Dockerfile index fe8b728..0f50918 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,7 +34,7 @@ RUN ./build-toolchain.sh RUN rm -rf ${N64_INST}/share/locale/* # Stage 2 - Prepare minimal image -FROM debian:11.1-slim +FROM debian:stable-slim # Avoid warnings by switching to noninteractive ENV DEBIAN_FRONTEND=noninteractive # Setup paths for the libgragon toolchain From 30abbf8bb8f622072978c7075247e8545adb4f0f Mon Sep 17 00:00:00 2001 From: Robin Jones Date: Fri, 13 Jan 2023 20:56:33 +0000 Subject: [PATCH 55/55] Fix dockerfile --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0f50918..8f6b8c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,9 +26,9 @@ ARG N64_INST=/n64_toolchain ENV N64_INST=${N64_INST} # Build -COPY ./tools/build-toolchain.sh /tmp/tools/build-toolchain.sh +ADD https://raw.githubusercontent.com/DragonMinded/libdragon/trunk/tools/build-toolchain.sh /tmp/tools/build-toolchain.sh WORKDIR /tmp/tools -RUN ./build-toolchain.sh +RUN chmod 755 "./build-toolchain.sh" && ./build-toolchain.sh # Remove locale strings which are not so important in our use case RUN rm -rf ${N64_INST}/share/locale/*