From ea2a0133c80c447932cf79a31b927dace7efa8e6 Mon Sep 17 00:00:00 2001 From: Dustin Blackman Date: Tue, 12 Mar 2024 08:07:21 -0400 Subject: [PATCH] chore: Attempt building outside qemu --- .devcontainer/build.sh | 20 ++++++- .github/workflows/devcontainer.yml | 84 ++++++++++++++++-------------- 2 files changed, 62 insertions(+), 42 deletions(-) diff --git a/.devcontainer/build.sh b/.devcontainer/build.sh index d64c4c2..f694dce 100755 --- a/.devcontainer/build.sh +++ b/.devcontainer/build.sh @@ -13,5 +13,21 @@ export EMPTY_GITHUB_TOKEN="$2" npm ci ) -echo "[BUILD] Building $BUILD_ARCH" -tools/node/node_modules/.bin/devcontainer build --workspace-folder . --config ./.devcontainer/devcontainer-src.json --push --platform "linux/$BUILD_ARCH" --image-name ghcr.io/dustinblackman/devcontainer-oatmeal:latest-"$BUILD_ARCH" +echo "$EMPTY_GITHUB_TOKEN" | gh auth login --with-token +sudo apt-get update +sudo apt-get install gcc-aarch64-linux-gnu +rustup target add aarch64-unknown-linux-gnu +cargo install cargo-run-bin +cargo binstall --help +export CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu +cargo bin committed --help || echo "" +cargo bin mise --help || echo "" +cargo cmd --help || echo "" +cargo nextest --help || echo "" +cargo insta --help || echo "" +cargo deny --helpA || echo "" +cargo watch --help || echo "" +find .bin + +# echo "[BUILD] Building $BUILD_ARCH" +# tools/node/node_modules/.bin/devcontainer build --workspace-folder . --config ./.devcontainer/devcontainer-src.json --push --platform "linux/$BUILD_ARCH" --image-name ghcr.io/dustinblackman/devcontainer-oatmeal:latest-"$BUILD_ARCH" diff --git a/.github/workflows/devcontainer.yml b/.github/workflows/devcontainer.yml index 8361ac9..020be37 100644 --- a/.github/workflows/devcontainer.yml +++ b/.github/workflows/devcontainer.yml @@ -1,7 +1,7 @@ on: push: branches: - - dev-container + - devcontainerhack paths: - '.devcontainer/Dockerfile' - '.devcontainer/devcontainer-src.json' @@ -15,7 +15,8 @@ jobs: environment: devcontainer strategy: matrix: - arch: ["arm64", "amd64"] + # arch: ["arm64", "amd64"] + arch: ["arm64"] permissions: packages: write steps: @@ -38,45 +39,48 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 18.19.0 + - uses: dtolnay/rust-toolchain@stable + with: + targets: aarch64-unknown-linux-gnu - name: Build run: | ./.devcontainer/build.sh ${{ matrix.arch }} ${{ secrets.EMPTY_GITHUB_TOKEN }} - release: - runs-on: ubuntu-latest - needs: [build] - permissions: - contents: write - pull-requests: write - packages: write - steps: - - uses: actions/checkout@v2 - - name: Set up QEMU - # v3 - uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 - with: - image: tonistiigi/binfmt@sha256:6088cbd69c369178ffd6b68992f342c3a9d5c3cc619bbaa4bfe9a98cb23893d0 - - name: Set up Docker Buildx - # v3.1.0 - uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c - - name: Login to GitHub Container Registry - # v3.0.0 - uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d - with: - registry: ghcr.io - username: ${{github.actor}} - password: ${{secrets.GITHUB_TOKEN}} - - uses: actions/setup-node@v4 - with: - node-version: 18.19.0 - - name: Release - env: - GH_TOKEN: ${{ github.token }} - run: | - sudo curl -L -o /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_amd64 - if [[ "$(sha256sum /usr/local/bin/yq | awk '{print $1}')" != "1a95960dddd426321354d58d2beac457717f7c49a9ec0806749a5a9e400eb45e" ]]; then - echo "yq checksum failed" - exit 1 - fi - sudo chmod +x /usr/local/bin/yq - ./.devcontainer/release.sh + # release: + # runs-on: ubuntu-latest + # needs: [build] + # permissions: + # contents: write + # pull-requests: write + # packages: write + # steps: + # - uses: actions/checkout@v2 + # - name: Set up QEMU + # # v3 + # uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 + # with: + # image: tonistiigi/binfmt@sha256:6088cbd69c369178ffd6b68992f342c3a9d5c3cc619bbaa4bfe9a98cb23893d0 + # - name: Set up Docker Buildx + # # v3.1.0 + # uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c + # - name: Login to GitHub Container Registry + # # v3.0.0 + # uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d + # with: + # registry: ghcr.io + # username: ${{github.actor}} + # password: ${{secrets.GITHUB_TOKEN}} + # - uses: actions/setup-node@v4 + # with: + # node-version: 18.19.0 + # - name: Release + # env: + # GH_TOKEN: ${{ github.token }} + # run: | + # sudo curl -L -o /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.42.1/yq_linux_amd64 + # if [[ "$(sha256sum /usr/local/bin/yq | awk '{print $1}')" != "1a95960dddd426321354d58d2beac457717f7c49a9ec0806749a5a9e400eb45e" ]]; then + # echo "yq checksum failed" + # exit 1 + # fi + # sudo chmod +x /usr/local/bin/yq + # ./.devcontainer/release.sh