Skip to content

Commit

Permalink
chore: Attempt building outside qemu
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinblackman committed Mar 12, 2024
1 parent 9e2d951 commit de4b810
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 42 deletions.
19 changes: 17 additions & 2 deletions .devcontainer/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,20 @@ 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
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"
84 changes: 44 additions & 40 deletions .github/workflows/devcontainer.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- dev-container
- devcontainerhack
paths:
- '.devcontainer/Dockerfile'
- '.devcontainer/devcontainer-src.json'
Expand All @@ -15,7 +15,8 @@ jobs:
environment: devcontainer
strategy:
matrix:
arch: ["arm64", "amd64"]
# arch: ["arm64", "amd64"]
arch: ["arm64"]
permissions:
packages: write
steps:
Expand All @@ -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

0 comments on commit de4b810

Please sign in to comment.