diff --git a/.github/workflows/bootstrap-deps.sh b/.github/workflows/bootstrap-deps.sh index 0ad73e4..fae739f 100755 --- a/.github/workflows/bootstrap-deps.sh +++ b/.github/workflows/bootstrap-deps.sh @@ -16,36 +16,58 @@ function get_linux_deb_arch() { "linux-i686") echo "i386" ;; "linux-riscv64") echo "riscv64" ;; "linux-x86_64") echo "amd64" ;; - "win32"|"win64") echo "i386" ;; esac } function install_compiler() { case "${1}" in "linux-aarch64") - apt-get install -yqq g++-aarch64-linux-gnu + if [ "$(uname -m)" != "aarch64" ]; then + apt-get install -yqq g++-aarch64-linux-gnu + else + apt-get install -yqq g++ + fi ;; "linux-armhf") - apt-get install -yqq g++-arm-linux-gnueabihf + if [ "$(uname -m)" != "armhf" ]; then + apt-get install -yqq g++-arm-linux-gnueabihf + else + apt-get install -yqq g++ + fi ;; "linux-i686") - apt-get install -yqq g++-i686-linux-gnu + if [ "$(uname -m)" != "i686" ]; then + apt-get install -yqq g++-i686-linux-gnu + else + apt-get install -yqq g++ + fi ;; "linux-riscv64") - apt-get install -yqq g++-riscv64-linux-gnu + if [ "$(uname -m)" != "riscv64" ]; then + apt-get install -yqq g++-riscv64-linux-gnu + else + apt-get install -yqq g++ + fi ;; "linux-x86_64") - # FIXME this assumes build runner is x86_64 - apt-get install -yqq g++ + if [ "$(uname -m)" != "x86_64" ]; then + apt-get install -yqq g++-x86_64-linux-gnu + else + apt-get install -yqq g++ + fi ;; "wasm") [ -e ~/PawPawBuilds/emsdk ] || git clone https://github.com/emscripten-core/emsdk.git ~/PawPawBuilds/emsdk cd ~/PawPawBuilds/emsdk && ./emsdk install ${EMSCRIPTEN_VERSION} && ./emsdk activate ${EMSCRIPTEN_VERSION} ;; "win32") + dpkg --add-architecture i386 + apt-get update -qq apt-get install -yqq binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 wine-stable ;; "win64") + dpkg --add-architecture i386 + apt-get update -qq apt-get install -yqq binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable ;; esac @@ -56,10 +78,10 @@ case "${1}" in brew install cmake git jq meson ;; *) - sed -i "s/deb http/deb [arch=amd64] http/" /etc/apt/sources.list - sed -i "s/deb mirror/deb [arch=amd64] mirror/" /etc/apt/sources.list + sed -i "s/deb http/deb [arch=i386,amd64] http/" /etc/apt/sources.list + sed -i "s/deb mirror/deb [arch=i386,amd64] mirror/" /etc/apt/sources.list apt-get update -qq - apt-get install -yqq autoconf automake autopoint binfmt-support build-essential curl cmake git jq lsb-release meson gperf qemu-user-static + apt-get install -yqq autoconf automake autopoint binfmt-support build-essential curl cmake git jq lsb-release meson gperf patchelf qemu-user-static arch=$(get_linux_deb_arch "${1}") release=$(lsb_release -cs) diff --git a/.github/workflows/bootstrap.yml b/.github/workflows/bootstrap.yml index 32fe54d..9e97eeb 100644 --- a/.github/workflows/bootstrap.yml +++ b/.github/workflows/bootstrap.yml @@ -4,7 +4,7 @@ on: push: env: - CACHE_VERSION: 3 + CACHE_VERSION: 1 DEBIAN_FRONTEND: noninteractive EMSCRIPTEN_VERSION: 3.1.27 PAWPAW_SKIP_TESTS: 1 @@ -14,6 +14,46 @@ jobs: strategy: matrix: include: + # macos + - target: macos + os: macos-11 + - target: macos-universal + os: macos-11 + - target: macos-universal-10.15 + os: macos-11 + # ubuntu:18.04 + - target: linux-aarch64 + os: ubuntu-latest + container: ubuntu:18.04 + - target: linux-armhf + os: ubuntu-latest + container: ubuntu:18.04 + - target: linux-i686 + os: ubuntu-latest + container: ubuntu:18.04 + #- target: linux-riscv64 + #os: ubuntu-latest + #container: ubuntu:18.04 + - target: linux-x86_64 + os: ubuntu-latest + container: ubuntu:18.04 + # ubuntu:20.04 + - target: linux-aarch64 + os: ubuntu-latest + container: ubuntu:20.04 + - target: linux-armhf + os: ubuntu-latest + container: ubuntu:20.04 + - target: linux-i686 + os: ubuntu-latest + container: ubuntu:20.04 + - target: linux-riscv64 + os: ubuntu-latest + container: ubuntu:20.04 + - target: linux-x86_64 + os: ubuntu-latest + container: ubuntu:20.04 + # ubuntu:22.04 - target: linux-aarch64 os: ubuntu-latest container: ubuntu:22.04 @@ -29,12 +69,6 @@ jobs: - target: linux-x86_64 os: ubuntu-latest container: ubuntu:22.04 - - target: macos - os: macos-11 - - target: macos-universal - os: macos-11 - - target: macos-universal-10.15 - os: macos-11 - target: wasm os: ubuntu-latest container: ubuntu:22.04 @@ -54,7 +88,7 @@ jobs: with: path: | ~/PawPawBuilds - key: common-${{ matrix.target }}-v${{ env.CACHE_VERSION }} + key: common-${{ matrix.container }}-${{ matrix.target }}-v${{ env.CACHE_VERSION }} - name: Set up dependencies run: | ./.github/workflows/bootstrap-deps.sh ${{ matrix.target }} @@ -66,13 +100,19 @@ jobs: fi ./bootstrap-common.sh ${{ matrix.target }} && ./.cleanup.sh ${{ matrix.target }} - name: Pack bootstrap build + if: ${{ matrix.os == 'macos-11' }} + shell: bash + run: | + tar -C ~/PawPawBuilds -czf common-${{ matrix.container || matrix.os }}-${{ matrix.target }}.tar.gz builds targets + - name: Pack bootstrap build + if: ${{ matrix.os != 'macos-11' }} shell: bash run: | - tar -C ~/PawPawBuilds -czf common-${{ matrix.target }}.tar.gz builds targets + tar -C ~/PawPawBuilds --force-local -czf common-${{ matrix.container || matrix.os }}-${{ matrix.target }}.tar.gz builds targets - uses: actions/upload-artifact@v3 with: - name: common-${{ matrix.target }} - path: common-${{ matrix.target }}.tar.gz + name: common-${{ matrix.container || matrix.os }}-${{ matrix.target }} + path: common-${{ matrix.container || matrix.os }}-${{ matrix.target }}.tar.gz #plugins: #strategy: