Skip to content

Commit

Permalink
Merge pull request #547 from Mossaka/pub-oci-tar-builder
Browse files Browse the repository at this point in the history
ci(*): publish oci-tar-builder binary in the ci
  • Loading branch information
Mossaka authored Nov 18, 2024
2 parents 8963d7e + 2acf23f commit 63043f1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
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 @@ -84,6 +84,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 @@ -148,6 +148,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

0 comments on commit 63043f1

Please sign in to comment.