commit 6a1f941545d603f955047c1a078e384680b4c366 Author: Luke Street Date: Tue Dec 19 00:01:15 2023 -0700 Initial commit diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1ca368c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,60 @@ +name: Build + +on: + push: + paths-ignore: + - '*.md' + - 'LICENSE*' + pull_request: + +jobs: + build-linux: + name: Build + strategy: + matrix: + platform: + - linux/amd64 + - linux/386 + - linux/armv7 + - linux/arm64/v8 + fail-fast: false + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build + run: docker build --target export --output build . --platform ${{ matrix.platform }} + - name: Upload artifacts + uses: actions/upload-artifact@v2 + with: + name: artifacts + path: build + + release: + name: Release + # if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + needs: [ build-linux ] + steps: + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + - name: List artifacts + run: ls -R artifacts + # - name: Rename artifacts + # working-directory: artifacts + # run: | + # mkdir ../out + # for i in */*/$BUILD_PROFILE/$CARGO_BIN_NAME*; do + # mv "$i" "../out/$(sed -E "s/([^/]+)\/[^/]+\/$BUILD_PROFILE\/($CARGO_BIN_NAME)/\2-\1/" <<< "$i")" + # done + # ls -R ../out + # - name: Release + # uses: softprops/action-gh-release@v1 + # with: + # files: out/* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bb0f9fd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# Build stage +FROM alpine:3.19.0 AS build + +# Install dependencies +RUN apk add --no-cache gcc musl-dev make + +# Download and extract source +RUN wget -qO- https://ftp.gnu.org/gnu/binutils/binutils-2.41.tar.xz | tar -xJ + +# Build binutils +WORKDIR /binutils-2.41 +RUN ./configure --target=powerpc-unknown-eabi --prefix=/target --disable-nls --disable-shared \ + && make -j$(nproc) configure-host \ + && make -j$(nproc) LDFLAGS=-all-static \ + && make install-strip + +# Export binary (usage: docker build --target export --output build .) +FROM scratch AS export +COPY --from=build /target/bin/* .