From 48ec920917675eecad703fbe08907ee941cc6352 Mon Sep 17 00:00:00 2001 From: Jacob Weinstock Date: Wed, 13 Nov 2024 11:29:32 -0700 Subject: [PATCH] Add ISO builds to CI: This adds ISO builds to CI and releases. Remove deprecated CI directory. Signed-off-by: Jacob Weinstock --- .github/workflows/build-all-matrix.yaml | 22 ++- .github/workflows/deprecated/ci.yaml | 162 ------------------ .../deprecated/formatters-and-linters.sh | 31 ---- .github/workflows/deprecated/kernel-ci.yaml | 30 ---- .github/workflows/deprecated/kernel-push.yaml | 24 --- build.sh | 2 +- 6 files changed, 19 insertions(+), 252 deletions(-) delete mode 100644 .github/workflows/deprecated/ci.yaml delete mode 100755 .github/workflows/deprecated/formatters-and-linters.sh delete mode 100644 .github/workflows/deprecated/kernel-ci.yaml delete mode 100644 .github/workflows/deprecated/kernel-push.yaml diff --git a/.github/workflows/build-all-matrix.yaml b/.github/workflows/build-all-matrix.yaml index 393a833a..07af0f28 100644 --- a/.github/workflows/build-all-matrix.yaml +++ b/.github/workflows/build-all-matrix.yaml @@ -19,7 +19,7 @@ env: # Global environment, passed to all jobs & all steps # To do so, set the secret DOCKERHUB_USERNAME and DOCKERHUB_PASSWORD in the repo secrets, and set the below to yes. LOGIN_TO_DOCKERHUB: "yes" - HOOK_VERSION: "0.9.1-build-${{github.run_number}}" # Use a forced Hook version + HOOK_VERSION: "0.9.2-build-${{github.run_number}}" # Use a forced Hook version # Which flavors to build? space separated list, must match one of the TAG='s in flavors (this is used by matrix_prep job in gha-matrix command) CI_TAGS: "standard armbian-sbc armbian-uefi lts" # 'dev' is not included @@ -165,11 +165,19 @@ jobs: DO_BUILD_LK_CONTAINERS: "no" # already built them; this is only for hook/linuxkit. run: bash build.sh build "${{ matrix.kernel }}" + - name: "Build Hook ISO with Kernel ${{matrix.kernel}} (${{ matrix.arch }}) - cache: ${{matrix.gha_cache}}" + if: ${{ matrix.kernel == 'hook-latest-lts-amd64' || matrix.kernel == 'hook-default-amd64' || matrix.kernel == 'hook-latest-lts-arm64' || matrix.kernel == 'hook-default-arm64' }} + env: + DO_BUILD_LK_CONTAINERS: "no" # already built them; this is only for hook/linuxkit. + run: bash build.sh build "${{ matrix.kernel }}" LINUXKIT_ISO=yes + - name: Upload deb as artifact ${{ matrix.arch.name }} ${{ matrix.distro }} uses: actions/upload-artifact@v4 with: name: "hook-tarball-${{ matrix.kernel }}" - path: out/*.tar.gz + path: | + out/*.tar.gz + out/*.iso release-latest: name: Publish all Hooks to GitHub Releases @@ -226,7 +234,9 @@ jobs: uses: jmgilman/actions-generate-checksum@v1 with: method: sha512 - patterns: "*.tar.gz" + patterns: | + "*.tar.gz" + "*.iso" - name: Update latest release uses: softprops/action-gh-release@v2 @@ -235,6 +245,7 @@ jobs: body: ${{env.RELEASE_NOTES}} files: | *.tar.gz + *.iso checksum.txt prerelease: true tag_name: latest @@ -270,7 +281,9 @@ jobs: uses: jmgilman/actions-generate-checksum@v1 with: method: sha512 - patterns: "*.tar.gz" + patterns: | + "*.tar.gz" + "*.iso" - name: Update tag release uses: softprops/action-gh-release@v2 @@ -279,6 +292,7 @@ jobs: body: ${{env.RELEASE_NOTES}} files: | *.tar.gz + *.iso checksum.txt prerelease: true tag_name: ${{github.ref}} diff --git a/.github/workflows/deprecated/ci.yaml b/.github/workflows/deprecated/ci.yaml deleted file mode 100644 index ff1031a1..00000000 --- a/.github/workflows/deprecated/ci.yaml +++ /dev/null @@ -1,162 +0,0 @@ -name: For each PR and Push -on: - pull_request: - push: -jobs: - validation: - runs-on: ubuntu-20.04 - outputs: - commitid: ${{steps.commitid.outputs.short}} - steps: - - name: Setup Dynamic Env - run: | - echo "MAKEFLAGS=-j$(nproc)" | tee $GITHUB_ENV - - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to quay.io - if: github.ref == 'refs/heads/main' - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_PASSWORD }} - - - name: Figure Out Commit Short ID - id: commitid - run: | - echo ::set-output name=short::$(git rev-parse --short HEAD) - - - name: Install nix - uses: cachix/install-nix-action@v26 - with: - nix_path: nixpkgs=channel:nixos-unstable - - - name: Fetch Nix Deps - run: nix-shell --command true - - - name: Run formatters and linters - run: nix-shell --run .github/workflows/formatters-and-linters.sh - - - name: Build Hook Tarballs - run: | - # fixes "write /run/user/1001/355792648: no space left on device" error - sudo mount -o remount,size=3G /run/user/1001 || true - nix-shell --run 'make TAG=${{steps.commitid.outputs.short}} dist' - - - name: Publish Hook - if: github.ref == 'refs/heads/main' - run: | - # Build and push the container images - nix-shell --run 'make TAG=${{steps.commitid.outputs.short}} push' - nix-shell --run 'make TAG=latest push' - - - uses: actions/upload-artifact@v4 - with: - name: hook-${{steps.commitid.outputs.short}} - path: out/${{steps.commitid.outputs.short}}/rel/hook_*.tar.gz - - publish-release-latest: - runs-on: ubuntu-20.04 - if: github.ref == 'refs/heads/main' - needs: validation - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Download Artifact - uses: actions/download-artifact@v4 - with: - name: hook-${{needs.validation.outputs.commitid}} - - - name: Delete Tag - run: | - git tag -d latest || echo "no local tag to delete" - git push origin :latest -f || echo "no remote tag to delete" - - - name: Generate Release Notes - run: | - generated_release_notes=$(gh api 'repos/{owner}/{repo}/releases/generate-notes' -F tag_name=latest --jq .body) - cat >>"$GITHUB_ENV" <<-EOF - RELEASE_NOTES<>"$GITHUB_ENV" <<-EOF - RELEASE_NOTES<> $GITHUB_ENV - - - run: make -C kernel devbuild ORG=${REGISTRY}:5000 - - # TODO: add artifacts for the built images - #- uses: actions/upload-artifact@v3 - # with: - # name: TODO - # path: TODO diff --git a/.github/workflows/deprecated/kernel-push.yaml b/.github/workflows/deprecated/kernel-push.yaml deleted file mode 100644 index d1f0cf08..00000000 --- a/.github/workflows/deprecated/kernel-push.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: For each Kernel commit -on: - push: - paths: - - kernel/** - - "!kernel/README.md" - branches: - - "**" -jobs: - kernel-publish: - runs-on: self-hosted - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Login to quay.io - if: ${{ github.actor != 'dependabot[bot]' }} - uses: docker/login-action@v3 - with: - registry: quay.io - username: ${{ secrets.QUAY_USERNAME }} - password: ${{ secrets.QUAY_PASSWORD }} - - - run: make -C kernel build diff --git a/build.sh b/build.sh index e07f7884..87b6dc20 100755 --- a/build.sh +++ b/build.sh @@ -43,7 +43,7 @@ else # otherwise default to tty, but allow override fi # Set the default HOOK_VERSION; override with env var; -x exports it for envsubst later -declare -g -r -x HOOK_VERSION="${HOOK_VERSION:-"0.9.1"}" +declare -g -r -x HOOK_VERSION="${HOOK_VERSION:-"0.9.2"}" log info "Using Hook version (HOOK_VERSION): ${HOOK_VERSION}" ### Inventory