Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/actions/bake/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: 'bake'
description: 'builds a containerbase image using Docker Buildx'
inputs:
token:
description: 'GitHub token'
default: ${{ github.token }}
required: true
args:
description: 'Arguments for Docker Buildx bake'
default: ''

runs:
using: 'composite'

steps:
- name: fetch dist
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist

- name: fix executable
shell: bash
run: |
chmod +x dist/cli/*
chmod +x dist/docker/usr/local/containerbase/bin/*
chmod +x dist/docker/usr/local/sbin/*

- name: bake
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 60
polling_interval_seconds: 5
command: docker buildx bake --set settings.secrets=type=env,id=GITHUB_TOKEN ${{ inputs.args }}
env:
GITHUB_TOKEN: ${{ inputs.token }}
10 changes: 10 additions & 0 deletions .github/actions/check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ runs:
using: 'composite'

steps:
- name: Set Up contained image store
shell: bash
run: |
if [ ! -f /etc/docker/daemon.json ]; then
echo "{}" | sudo tee /etc/docker/daemon.json
fi
cat /etc/docker/daemon.json | jq '. | .+{"features": {"containerd-snapshotter": true}}' | sudo tee /etc/docker/daemon.json
cat /etc/docker/daemon.json
sudo systemctl restart docker

- name: ⚙️ Check docker service
shell: bash
run: |
Expand Down
11 changes: 0 additions & 11 deletions .github/actions/prepare-proxy/action.yml

This file was deleted.

119 changes: 34 additions & 85 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ jobs:
steps:
- name: ⚙️ Setup
uses: containerbase/internal-tools/setup@5deae3a281a98870784309f9017eff5e54d2bf31 # v4.5.0
with:
node: false
apt-proxy: true

- name: Check system
uses: ./.github/actions/check
Expand All @@ -163,32 +166,14 @@ jobs:
echo "OWNER=${OWNER,,}" >> ${GITHUB_ENV}
echo "BASE=ttl.sh/${{ needs.setup.outputs.uid }}/${{ matrix.arch.tag }}:1d" >> ${GITHUB_ENV}

- name: prepare apt proxy
uses: ./.github/actions/prepare-proxy

- name: fetch dist
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
- name: build base
uses: ./.github/actions/bake
with:
name: dist
path: dist

- name: fix executable
run: |
chmod +x dist/cli/*
chmod +x dist/docker/usr/local/containerbase/bin/*
chmod +x dist/docker/usr/local/sbin/*

- name: test distro
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 60
polling_interval_seconds: 5
command: docker buildx bake --set build-ttl.tags=${{env.BASE}} build-ttl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# CONTAINERBASE_CDN: ${{ vars.CONTAINERBASE_CDN }}
args: >-
--set build-ttl.tags=${{env.BASE}}
--set build-ttl.cache-to=type=gha,mode=max,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }}
--set settings.cache-from+=type=gha,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }}
build-ttl

distro:
runs-on: ubuntu-24.04
Expand All @@ -211,6 +196,9 @@ jobs:
steps:
- name: ⚙️ Setup
uses: containerbase/internal-tools/setup@5deae3a281a98870784309f9017eff5e54d2bf31 # v4.5.0
with:
node: false
apt-proxy: true

- name: Check system
uses: ./.github/actions/check
Expand All @@ -219,32 +207,10 @@ jobs:
run: |
echo "OWNER=${OWNER,,}" >> ${GITHUB_ENV}

- name: prepare apt proxy
uses: ./.github/actions/prepare-proxy

- name: fetch dist
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist

- name: fix executable
run: |
chmod +x dist/cli/*
chmod +x dist/docker/usr/local/containerbase/bin/*
chmod +x dist/docker/usr/local/sbin/*

- name: test distro
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
uses: ./.github/actions/bake
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 60
polling_interval_seconds: 5
command: docker buildx bake test-distro --set settings.secrets=type=env,id=GITHUB_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# CONTAINERBASE_CDN: ${{ vars.CONTAINERBASE_CDN }}
args: test-distro

# test old distros on arm64
base-arm64:
Expand All @@ -268,6 +234,9 @@ jobs:
steps:
- name: ⚙️ Setup
uses: containerbase/internal-tools/setup@5deae3a281a98870784309f9017eff5e54d2bf31 # v4.5.0
with:
node: false
apt-proxy: true

- name: Check system
uses: ./.github/actions/check
Expand All @@ -276,32 +245,10 @@ jobs:
run: |
echo "OWNER=${OWNER,,}" >> ${GITHUB_ENV}

- name: prepare apt proxy
uses: ./.github/actions/prepare-proxy

- name: fetch dist
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: dist
path: dist

- name: fix executable
run: |
chmod +x dist/cli/*
chmod +x dist/docker/usr/local/containerbase/bin/*
chmod +x dist/docker/usr/local/sbin/*

- name: test distro
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
uses: ./.github/actions/bake
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 60
polling_interval_seconds: 5
command: docker buildx bake test-base --set settings.secrets=type=env,id=GITHUB_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# CONTAINERBASE_CDN: ${{ vars.CONTAINERBASE_CDN }}
args: test-base

lang:
runs-on: ${{ matrix.arch.os }}
Expand Down Expand Up @@ -358,6 +305,9 @@ jobs:
steps:
- name: ⚙️ Setup
uses: containerbase/internal-tools/setup@5deae3a281a98870784309f9017eff5e54d2bf31 # v4.5.0
with:
node: false
apt-proxy: true

- name: Check system
uses: ./.github/actions/check
Expand All @@ -367,20 +317,19 @@ jobs:
echo "OWNER=${OWNER,,}" >> ${GITHUB_ENV}
echo "BASE_IMAGE=ttl.sh/${{ needs.setup.outputs.uid }}/${{ matrix.arch.tag }}:1d" >> ${GITHUB_ENV}

- name: prepare apt proxy
uses: ./.github/actions/prepare-proxy
- name: build base
uses: ./.github/actions/bake
with:
args: >-
--set build-ttl.tags=${{env.BASE_IMAGE}}
--set build-ttl.cache-to=type=gha,mode=max,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }}
--set settings.cache-from+=type=gha,scope=${{ needs.setup.outputs.uid }}-${{ matrix.arch.tag }}
build-ttl

- name: test
uses: nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # v3.0.2
- name: test distro
uses: ./.github/actions/bake
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 60
polling_interval_seconds: 5
command: docker buildx bake test-${{ matrix.arch.name }} --set settings.secrets=type=env,id=GITHUB_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# CONTAINERBASE_CDN: ${{ vars.CONTAINERBASE_CDN }}
args: test-${{ matrix.arch.name }}

# Catch-all required check for test matrix
test-success:
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"lint-fix": "run-s prettier-fix eslint-fix 'lint-fix:*'",
"lint-fix:markdown": "markdownlint-cli2 --fix '**/*.md'",
"prepare": "husky",
"prepare:proxy": "node tools/prepare-proxy.js",
"prettier": "prettier --cache -c -u \"**/*.*\"",
"prettier-fix": "prettier --cache -w -u \"**/*.*\"",
"release:prepare": "node tools/prepare-release.js",
Expand Down
2 changes: 0 additions & 2 deletions tools/containerbase.acl

This file was deleted.

12 changes: 0 additions & 12 deletions tools/prepare-proxy.js

This file was deleted.

Loading