diff --git a/.github/workflows/image.yaml b/.github/workflows/image.yaml new file mode 100644 index 0000000..99bc7b7 --- /dev/null +++ b/.github/workflows/image.yaml @@ -0,0 +1,35 @@ +name: Build image + +on: + push: + branches: + - main + pull_request: + +concurrency: + group: ci-image-${{ github.head_ref || github.ref }}-${{ github.repository }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + permissions: + id-token: write # OIDC support + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v2 + - run: | + git fetch --prune --unshallow + - name: setup-docker + uses: docker-practice/actions-setup-docker@master + - name: Build 🔧 + run: | + ./earthly.sh +iso + - uses: actions/upload-artifact@v2 + with: + name: ipxe-artifacts.zip + path: | + build/* + if-no-files-found: error + \ No newline at end of file diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..4517c5d --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,29 @@ +name: Release + +on: + push: + tags: + - v* +jobs: + build: + runs-on: ubuntu-latest + permissions: + id-token: write # OIDC support + contents: write + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v2 + - run: | + git fetch --prune --unshallow + - name: setup-docker + uses: docker-practice/actions-setup-docker@master + - name: Build 🔧 + run: | + ./earthly.sh +iso + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: | + build/* \ No newline at end of file diff --git a/Earthfile b/Earthfile index 8dcb29c..7246178 100644 --- a/Earthfile +++ b/Earthfile @@ -20,7 +20,7 @@ iso: mtools syslinux isolinux gcc-arm-none-eabi git make gcc liblzma-dev mkisofs xorriso # jq docker WORKDIR /build - ARG ISO_NAME=${OS_ID} + ARG ISO_NAME=ipxe-dhcp COPY +version/VERSION ./ ARG VERSION=$(cat VERSION) diff --git a/earthly.sh b/earthly.sh new file mode 100755 index 0000000..12b82a9 --- /dev/null +++ b/earthly.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker run --privileged -v /var/run/docker.sock:/var/run/docker.sock --rm -t -v $(pwd):/workspace -v earthly-tmp:/tmp/earthly:rw earthly/earthly:v0.6.21 --allow-privileged $@ \ No newline at end of file