mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
aea81c0822
Build image with new input option Run most of the basic docker tests in E2E Signed-off-by: Derek Nola <derek.nola@suse.com>
52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
name: Build K3s
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
upload-repo:
|
|
type: boolean
|
|
required: false
|
|
default: false
|
|
upload-image:
|
|
type: boolean
|
|
required: false
|
|
default: false
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-20.04
|
|
timeout-minutes: 20
|
|
steps:
|
|
- name: Checkout K3s
|
|
uses: actions/checkout@v4
|
|
- name: Build K3s binary
|
|
run: |
|
|
DOCKER_BUILDKIT=1 SKIP_IMAGE=1 SKIP_AIRGAP=1 SKIP_VALIDATE=1 GOCOVER=1 make
|
|
sha256sum dist/artifacts/k3s | sed 's|dist/artifacts/||' > dist/artifacts/k3s.sha256sum
|
|
- name: Build K3s image
|
|
if: inputs.upload-image == true
|
|
run: make package-image
|
|
- name: bundle repo
|
|
if: inputs.upload-repo == true
|
|
run: |
|
|
tar -czvf ../k3s-repo.tar.gz .
|
|
mv ../k3s-repo.tar.gz .
|
|
- name: "Upload K3s directory"
|
|
if: inputs.upload-repo == true
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: k3s-repo.tar.gz
|
|
path: k3s-repo.tar.gz
|
|
- name: "Save K3s image"
|
|
if: inputs.upload-image == true
|
|
run: docker image save rancher/k3s -o ./dist/artifacts/k3s-image.tar
|
|
- name: "Upload K3s binary"
|
|
if: inputs.upload-repo == false
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: k3s
|
|
path: dist/artifacts/k3s* |