diff --git a/.github/workflows/build-base.yml b/.github/workflows/build-base.yml deleted file mode 100644 index a914373391..0000000000 --- a/.github/workflows/build-base.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Build base image - -on: - push: - branches: - - "main" - paths: - - "@base/**" - - ".github/workflows/build-base.yml" - schedule: - - cron: "0 7 * * *" - workflow_dispatch: - -jobs: - - test: - name: Build base image - permissions: - packages: write - runs-on: ubuntu-22.04 - steps: - - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Install uniget - uses: uniget-org/uniget-action@v1 - with: - prefix: helper - tools: gojq regclient - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: uniget-bot - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Build base image - run: | - make base - - - name: Store logs - uses: actions/upload-artifact@v3 - if: always() - with: - name: logs.zip - path: "@base/build.log" diff --git a/@base/Dockerfile b/@base/Dockerfile deleted file mode 100644 index 37bf607e58..0000000000 --- a/@base/Dockerfile +++ /dev/null @@ -1,69 +0,0 @@ -#syntax=docker/dockerfile:1.6.0 - -FROM nicholasdille/ubuntu:22.04 AS base - -ARG prefix_override=/uniget_bootstrap -ARG target_override=/usr/local -ENV uniget_cache=/var/cache/uniget \ - uniget_contrib=/var/lib/uniget/contrib \ - uniget_manifests=/var/lib/uniget/manifests \ - uniget_post_install=/var/lib/uniget/post_install \ - prefix=${prefix_override} \ - target=${target_override} -ARG TARGETPLATFORM -RUN </etc/profile.d/arch.sh -echo "export alt_arch=${alt_arch}" >/etc/profile.d/alt_arch.sh -EOF -COPY --chmod=0755 check-download.sh /etc/profile.d/ -COPY --chmod=0755 check-github-release-asset.sh /etc/profile.d/ -COPY --chmod=0755 check-clone.sh /etc/profile.d/ -SHELL [ "bash", "-clo", "errexit"] -RUN < " - exit 1 - fi - shift - - local ref=$1 - if test -z "${ref}"; then - echo "Usage: $0 " - exit 1 - fi - - echo "### Checking clone from repo ${repo} with ref ${ref}" - if git ls-remote --exit-code "${repo}" "${ref}"; then - echo " Found :-)" - return - fi - echo " ERROR: Unable to find ref ${ref} in repo ${repo}" - return 1 -} \ No newline at end of file diff --git a/@base/check-download.sh b/@base/check-download.sh deleted file mode 100755 index 2650bc46ca..0000000000 --- a/@base/check-download.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash -set -o errexit - -function check-download() { - local url="$1" - if test -z "${url}"; then - echo "Usage: $0 " - exit 1 - fi - - echo "### Checking ${url}" - if curl --silent --show-error --location --fail --head --url "${url}"; then - echo " Found :-)" - return - fi - echo " ERROR: Download ${url} not found" - return 1 -} \ No newline at end of file diff --git a/@base/check-github-release-asset.sh b/@base/check-github-release-asset.sh deleted file mode 100755 index ff6fa92913..0000000000 --- a/@base/check-github-release-asset.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -set -o errexit - -function check-github-release-asset() { - local repo="$1" - if test -z "${repo}"; then - echo "Usage: $0 " - exit 1 - fi - shift - - local version=$1 - if test -z "${version}"; then - echo "Usage: $0 " - exit 1 - fi - shift - - local asset=$1 - if test -z "${asset}"; then - echo "Usage: $0 " - exit 1 - fi - - local url="https://github.com/${repo}/releases/download/${version}/${asset}" - echo "### Checking ${repo} ${version} ${asset}" - if curl --silent --show-error --location --fail --head --url "${url}"; then - echo " Found :-)" - return - fi - echo " ERROR: Asset ${asset} not found for ${repo} ${version}" - echo " at ${url}" - - echo "### Fetching release assets for ${repo} ${version}" - local id - local url="https://api.github.com/repos/${repo}/releases/tags/${version}" - id="$(curl --silent --show-error --location "${url}" | jq --raw-output '.id')" - if test -z "${id}" || test "${id}" == "null"; then - echo " ERROR: Failed to fetch release id for ${repo} ${version}" - echo " at ${url}" - return 1 - fi - echo " Found release id ${id} for ${repo} ${version}" - - echo "### Fetching release assets for ${repo} ${version} with id ${id}" - local url="https://api.github.com/repos/${repo}/releases/${id}/assets" - if ! curl --silent --show-error --location --fail "${url}" | jq --raw-output '.[].name'; then - echo " ERROR: Failed to fetch release assets for ${repo} ${version}" - echo " at ${url}" - return 1 - fi - return 1 -} \ No newline at end of file diff --git a/make/tool.mk b/make/tool.mk index 1ef3d942b4..6b95a843f0 100644 --- a/make/tool.mk +++ b/make/tool.mk @@ -66,31 +66,6 @@ clean-builders: \ docker buildx ls | grep -q "^uniget " \ && docker builder prune --builder uniget --all --force -.PHONY: -base: \ - info \ - metadata.json \ - builders \ - ; $(info $(M) Building base image $(REGISTRY)/$(REPOSITORY_PREFIX)base:$(DOCKER_TAG)...) - @set -o errexit; \ - ARCHS="$$(jq --raw-output '[ .tools[] | select(.platforms != null) | .platforms[] ] | unique[]' metadata.json | paste -sd,)"; \ - echo "Platforms: $${ARCHS}"; \ - export SOURCE_DATE_EPOCH="$(SOURCE_DATE_EPOCH)"; \ - if ! docker buildx build @base \ - --builder uniget \ - --build-arg prefix_override=$(PREFIX) \ - --build-arg target_override=$(TARGET) \ - --platform $${ARCHS} \ - --cache-from $(REGISTRY)/$(REPOSITORY_PREFIX)base:$(DOCKER_TAG) \ - --tag $(REGISTRY)/$(REPOSITORY_PREFIX)base:$(DOCKER_TAG) \ - --provenance=false \ - --output type=registry,oci-mediatypes=true,push=true \ - --progress plain \ - >@base/build.log 2>&1; then \ - cat @base/build.log; \ - exit 1; \ - fi - .PHONY: $(ALL_TOOLS_RAW):%: \ $(HELPER)/var/lib/uniget/manifests/gojq.json \