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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
41 changes: 41 additions & 0 deletions .github/workflows/action-build-oci-tar-builder.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build oci-tar-builder

on:
workflow_call:
inputs:
os:
required: true
type: string

jobs:
build:
name: build oci-tar-builder
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
env:
RUST_CACHE_KEY_OS: rust-cache-${{ inputs.os }}
with:
rustflags: '' #Disable. By default this action sets environment variable is set to -D warnings. We manage this in the Makefile
- name: Build
run: make build-oci-tar-builder
- name: Run tests
timeout-minutes: 5
run: |
make test-oci-tar-builder
- name: Package artifacts
shell: bash
run: |
make dist-oci-tar-builder
# Check if there's any files to archive as tar fails otherwise
if stat dist/bin/* >/dev/null 2>&1; then
tar -czf dist/oci-tar-builder-${{ inputs.os }}.tar.gz -C dist/bin .
else
tar -czf dist/oci-tar-builder-${{ inputs.os }}.tar.gz -T /dev/null
fi
- name: Upload artifacts
uses: actions/upload-artifact@master
with:
name: oci-tar-builder-${{ inputs.os }}
jprendes marked this conversation as resolved.
Show resolved Hide resolved
path: dist/oci-tar-builder-${{ inputs.os }}.tar.gz
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@ 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", "windows-latest", "macos-14", "macos-12"] # macos-14 uses the arm64 architecture
uses: ./.github/workflows/action-build-oci-tar-builder.yml
with:
os: ${{ matrix.os }}

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 @@ -139,6 +139,10 @@ install-%: build-%
$(LN) ./containerd-shim-$*-v1 $(PREFIX)/bin/containerd-shim-$*d-v1
$(LN) ./containerd-shim-$*-v1 $(PREFIX)/bin/containerd-$*d

install-oci-tar-builder: build-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