From cadba6797ebdfa3aa8af2398bb80378726d19747 Mon Sep 17 00:00:00 2001 From: Rob Arnold Date: Sun, 24 Sep 2023 18:57:01 -0700 Subject: [PATCH 1/2] Set up usb builds with earthly (maybe) --- .github/workflows/build.yml | 36 ++++++++++++++++++++++++++++++++++++ Earthfile | 12 ++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..393e90a7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +--- +name: Build USB Sidecar + +on: # yamllint disable-line rule:truthy + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-container: + runs-on: "ubuntu-latest" + permissions: + contents: "read" + packages: "write" + + steps: + - uses: earthly/actions-setup@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + version: "0.7.1" + - uses: "actions/checkout@v3" + + - name: "Login to GitHub Container Hub" + if: github.event_name != 'pull_request' + run: docker login --username "${{ secrets.actor }}" --password "${{ secrets.GITHUB_TOKEN }}" --registry ghcr.io + + - name: "Build USB Container Image" + run: earthy +usb-image + env: + EARTHLY_CI: true + EARTHLY_PUSH: ${{ github.event_name != 'pull_request' }} + # Only one platform per https://docs.earthly.dev/docs/earthly-command#build-options + EARTHLY_PLATFORMS: linux/amd64 diff --git a/Earthfile b/Earthfile index d8c7667c..7e19b3dc 100644 --- a/Earthfile +++ b/Earthfile @@ -25,3 +25,15 @@ prettier-lint: lint: BUILD +prettier-lint + +usb-image: + FROM alpine + + RUN mkdir -p /usr/lib/extension-release.d/ + RUN echo ID=_any > /usr/lib/extension-release.d/extension-release.kubo + SAVE ARTIFACT /usr/lib/extension-release.d + SAVE ARTIFACT /usr/bin/lsusb + SAVE ARTIFACT /usr/bin/less + +images: + BUILD +usb-image From 2fe8d8da3625fdaf1d26e72f1e0ba1b282f24493 Mon Sep 17 00:00:00 2001 From: Rob Arnold Date: Sun, 24 Sep 2023 19:44:12 -0700 Subject: [PATCH 2/2] Update .github/workflows/build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 393e90a7..0c1eeea7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: run: docker login --username "${{ secrets.actor }}" --password "${{ secrets.GITHUB_TOKEN }}" --registry ghcr.io - name: "Build USB Container Image" - run: earthy +usb-image + run: earthly +usb-image env: EARTHLY_CI: true EARTHLY_PUSH: ${{ github.event_name != 'pull_request' }}