Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(*): publish oci-tar-builder binary in the ci #547

Merged
merged 9 commits into from
Nov 18, 2024
12 changes: 8 additions & 4 deletions .github/workflows/action-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ on:
sign:
default: false
type: boolean
binprefix:
default: containerd-shim-
type: string
required: false

jobs:
build-sign-upload:
Expand Down Expand Up @@ -73,13 +77,13 @@ jobs:
make dist-${{ inputs.runtime }}
# Check if there's any files to archive as tar fails otherwise
if stat dist/bin/* >/dev/null 2>&1; then
tar -czf dist/containerd-shim-${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -C dist/bin .
tar -czf dist/${{ inputs.binprefix }}${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -C dist/bin .
else
tar -czf dist/containerd-shim-${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -T /dev/null
tar -czf dist/${{ inputs.binprefix }}${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz -T /dev/null
fi
- name: Upload artifacts
if: ${{ inputs.runtime != 'common' }}
uses: actions/upload-artifact@master
with:
name: containerd-shim-${{ inputs.runtime }}-${{ inputs.slug }}
path: dist/containerd-shim-${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz
name: ${{ inputs.binprefix }}${{ inputs.runtime }}-${{ inputs.slug }}
path: dist/${{ inputs.binprefix }}${{ inputs.runtime }}-${{ inputs.slug }}.tar.gz
16 changes: 16 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,22 @@ jobs:
os: ${{ matrix.os }}
runtime: ${{ matrix.runtime }}
slug: "windows"

build-oci-tar-builder:
name: oci-tar-builder-${{ matrix.os }}
strategy:
matrix:
os: ["ubuntu-22.04"]
arch: ["x86_64", "aarch64"]
uses: ./.github/workflows/action-build.yml
with:
os: ${{ matrix.os }}
runtime: "oci-tar-builder"
target: "${{ matrix.arch }}-unknown-linux-gnu"
slug: "${{ matrix.arch }}-linux-gnu"
arch: ${{ matrix.arch }}
sign: false
binprefix: ""

smoke-tests:
name: ${{ matrix.runtime }}
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ install-%:
mkdir -p $(PREFIX)/bin
$(INSTALL) $(TARGET_DIR)$(TARGET)/$(OPT_PROFILE)/containerd-shim-$*-v1 $(PREFIX)/bin/

install-oci-tar-builder:
mkdir -p $(PREFIX)/bin
$(INSTALL) $(TARGET_DIR)$(TARGET)/$(OPT_PROFILE)/oci-tar-builder $(PREFIX)/bin/

.PHONY: dist dist-%
dist: $(RUNTIMES:%=dist-%);

Expand Down
Loading