diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d463a8..f027188 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,6 +26,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Space? + run: docker system prune --all - name: Set up QEMU uses: docker/setup-qemu-action@v3 with: @@ -38,8 +40,7 @@ jobs: with: context: ./ file: ./docker/${{ matrix.target }}.Dockerfile - cache-from: type=gha - cache-to: type=gha,mode=max + no-cache: true pull: true push: false load: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e7cf175..54b8897 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,9 @@ jobs: strategy: fail-fast: false matrix: - platform: [ amd64, arm64 ] + cross: + - aarch64-linux-gnu + - x86_64-linux-gnu target: - aarch64-unknown-linux-musl - armv7-unknown-linux-musleabihf @@ -22,6 +24,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Space? + run: docker system prune --all - name: Set up QEMU uses: docker/setup-qemu-action@v3 with: @@ -39,14 +43,16 @@ jobs: push: false load: true tags: ink-toolchain:dev - platforms: linux/${{ matrix.platform }} + build-args: | + CCONFIG=x86_64-linux-gnu---${{ matrix.cross }} + platforms: linux/amd64 builder: ${{ steps.buildx.outputs.name }} - name: Extract - run: TARGETARCH='${{ matrix.platform }}' ./scripts/extract.sh + run: ./scripts/extract.sh - name: Rename shell: bash working-directory: ./export - run: for f in *.tar.gz; do mv "$f" "${{ matrix.platform }}+$f"; done + run: for f in *.tar.gz; do mv "$f" "${{ matrix.cross }}+$f"; done - name: Hash shell: bash working-directory: ./export @@ -56,5 +62,6 @@ jobs: with: tag: ${{ github.ref_name }} name: ${{ github.ref_name }} + prerelease: ${{ contains('-dev', github.ref_name) }} allowUpdates: true artifacts: "./export/*.tar.gz,./export/*.sha256" diff --git a/docker/aaa.Dockerfile b/docker/aaa.Dockerfile new file mode 100644 index 0000000..70e0fc1 --- /dev/null +++ b/docker/aaa.Dockerfile @@ -0,0 +1,29 @@ +# syntax=docker/dockerfile:1 +FROM debian:12-slim as builder + +# Versioning +ARG CROSSTOOLNG_VERSION=crosstool-ng-1.26.0 + +# Do not set +ARG DEBIAN_FRONTEND=noninteractive +ARG TARGETARCH + +ARG RUST_TARGET +ARG CROSS_TOOLCHAIN + +RUN --mount=type=bind,source=./scripts/manage-apt.sh,target=/run.sh /run.sh + +RUN --mount=type=bind,source=./scripts/build-crosstool.sh,target=/run.sh /run.sh + +COPY ./config/${RUST_TARGET}.config /.config +ARG CCONFIG="" +COPY ./cconfig/${CCONFIG}.config /.cconfig +RUN --mount=type=bind,source=./scripts/build-cross.sh,target=/run.sh /run.sh + +RUN --mount=type=bind,source=./scripts/package.sh,target=/run.sh /run.sh + +FROM scratch + +WORKDIR /export + +COPY --from=builder /export/*.tar.gz . diff --git a/scripts/build-cross-old.sh b/scripts/build-cross-old.sh deleted file mode 100755 index 947f801..0000000 --- a/scripts/build-cross-old.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -set -euxo pipefail - -apt update -apt upgrade -y -apt install -y \ - gcc \ - g++ \ - gperf \ - bison \ - flex \ - texinfo \ - help2man \ - make \ - libncurses5-dev \ - python3-dev \ - autoconf \ - automake \ - libtool \ - libtool-bin \ - gawk \ - wget \ - bzip2 \ - xz-utils \ - unzip \ - patch \ - libstdc++6 \ - rsync \ - git \ - meson \ - ninja-build - -mkdir -p /tmp/build -pushd /tmp/build - -git clone --depth=1 -b "$CROSSTOOLNG_VERSION" https://github.com/crosstool-ng/crosstool-ng - -pushd ./crosstool-ng - -./bootstrap -./configure --prefix=/usr - -make -j`nproc` -make install - -popd -rm -rf ./crosstool-ng - -mv /.config . -ct-ng olddefconfig -ct-ng build - -# Package -pushd /tmp/toolchain - -tar -czvf "$CROSS_TOOLCHAIN".tar.gz . - -mkdir -p /export -mv *.tar.gz /export -#mv /export/*.tar.gz /export/export.tar.gz - -popd -popd