diff --git a/.github/workflows/dedup-jobs.yaml b/.github/workflows/dedup-jobs.yaml new file mode 100644 index 000000000..9dd61c315 --- /dev/null +++ b/.github/workflows/dedup-jobs.yaml @@ -0,0 +1,61 @@ +on: + push + +jobs: + get-artifact-list: + runs-on: ubuntu-latest + steps: + - name: get the list + run: | + git clone https://github.com/kata-containers/packaging kata-packaging + pushd kata-packaging + tag=`echo $GITHUB_REF | cut -d/ -f3-` + git checkout master + popd + ./kata-packaging/artifact-list.sh > artifact-list.txt + cat artifact-list.txt + - name: save-artifact-list + uses: actions/upload-artifact@master + with: + name: artifact-list + path: artifact-list.txt + build-kernel: + runs-on: ubuntu-16.04 + needs: get-artifact-list + steps: + - uses: actions/checkout@v1 + - name: get-artifact-list + uses: actions/download-artifact@master + with: + name: artifact-list + - name: build-kernel + run: | + if grep -q "install_kernel" ./artifact-list/artifact-list.txt; then + ls -la $GITHUB_WORKSPACE + .github/workflows/generate-artifact-tarball.sh "install_kernel" $GITHUB_REF + # install kernel dependencies + sudo apt-get update && sudo apt install -y flex bison libelf-dev bc iptables + export GOPATH=$HOME/go + go get github.com/kata-containers/packaging || true + pushd $GOPATH/src/github.com/kata-containers/packaging/release >>/dev/null + # Get versions information + tag=`echo $GITHUB_REF | cut -d/ -f3-` + git checkout $tag + pushd ../obs-packaging + ./gen_versions_txt.sh $tag + popd + # Build the kernel: + source ./kata-deploy-binaries.sh + install_kernel + echo ::set-env name=artifact-built::true + popd >>/dev/null + mv $HOME/go/src/github.com/kata-containers/packaging/release/kata-kernel.tar.gz . + else + echo ::set-env name=artifact-built::false + fi + - name: store-artifacts + if: env.artifact-built == 'true' + uses: actions/upload-artifact@master + with: + name: kata-artifacts + path: kata-kernel.tar.gz diff --git a/.github/workflows/generate-artifact-tarball.sh b/.github/workflows/generate-artifact-tarball.sh new file mode 100755 index 000000000..aa0d7684d --- /dev/null +++ b/.github/workflows/generate-artifact-tarball.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# Copyright (c) 2018 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 +# + +[ -z "${DEBUG}" ] || set -x +set -o errexit +set -o nounset +set -o pipefail + + +main() { + artifact=${1:-} + if [ -n "${artifact}" ]; then + "Scripts needs artifact name to build" + exit 1 + fi + info "artifact name: ${artifact}" + + github_ref=${2:-} + if [ -n "${github_ref}" ]; then + "Scripts needs githun reference to build" + exit 1 + fi + + tag=`echo ${github_ref} | cut -d/ -f3-` + export GOPATH=$HOME/go + + echo tag: "tag" + echo artifact "artifact_name" +} + +main $@ diff --git a/.github/workflows/kata-deploy.yaml b/.github/workflows/kata-deploy.yaml index 47997f33e..531867f53 100644 --- a/.github/workflows/kata-deploy.yaml +++ b/.github/workflows/kata-deploy.yaml @@ -1,4 +1,4 @@ -on: push +#on: push name: Build, Test, and Publish kata-deploy diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8871f1819..a01d493e0 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,7 +1,7 @@ -on: - push: - tags: - - '*' +#on: +# push: +# tags: +# - '*' jobs: get-artifact-list: