ci: fix publish path #586
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | ||
push: | ||
pull_request: | ||
name: build | ||
jobs: | ||
build: | ||
name: build | ||
runs-on: self-hosted | ||
steps: | ||
env: | ||
USERNAME: ${{ secrets.ZOTHUB_USERNAME }} | ||
PASSWORD: ${{ secrets.ZOTHUB_PASSWORD }} | ||
- name: Set up environment | ||
run: | | ||
mkdir ~/bin | ||
echo "PATH=$HOME/bin:$PATH" >> $GITHUB_ENV | ||
- name: Check out git | ||
uses: actions/checkout@v3 | ||
- name: Set up golang | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.21 | ||
- name: setup host | ||
run: | | ||
bash ./tools/setup-host.bash | ||
- name: lint | ||
run: | | ||
make gofmt | ||
TOPDIR=$(git rev-parse --show-toplevel) | ||
echo "setting TOPDIR=${TOPDIR}" | ||
echo "TOPDIR=${TOPDIR}" >> $GITHUB_ENV | ||
- name: make | ||
run: | | ||
go get -v ./... | ||
make | ||
- name: test | ||
run: | | ||
nohup ~/bin/machined > /tmp/machined.out 2>&1 & | ||
timeout 60m make test | ||
timeout 20m bats tests/livecd1.bats | ||
timeout 20m bats tests/livecd2.bats | ||
- name: show journal output | ||
if: always() | ||
run: | | ||
set -x | ||
cat /tmp/machined.out | ||
sudo dmesg | ||
sudo df -h | ||
touch /tmp/fini | ||
# Uncomment the below to check the job after done | ||
# while [ ! -f /tmp/shutdown ]; do sleep 5s; done | ||
- name: Rename Binary | ||
run: | | ||
cp trust trust-linux-amd64 | ||
cp mosb mosb-linux-amd64 | ||
cp mosctl mosctl-linux-amd64 | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
mosb-linux-amd64 | ||
mosctl-linux-amd64 | ||
trust-linux-amd64 | ||
- name: Set env | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: publish provision and install layer | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
make publish | ||
env: | ||
ZOT_VERSION=2.0.0-rc5 | ||
ROOTFS_VERSION=v0.0.17.231018 | ||
TOPDIR=${{ env.TOPDIR }} | ||
URL=docker://zothub.io/machine/bootkit | ||
build_arm64: | ||
runs-on: ubuntu-latest | ||
name: Build on ubuntu-latest arm64 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: uraimo/run-on-arch-action@v2 | ||
with: | ||
arch: aarch64 | ||
distro: ubuntu22.04 | ||
githubToken: ${{ github.token }} | ||
install: | | ||
apt-get -y update; | ||
apt-get install -q -y git golang-go; | ||
apt-get install -y bats curl golang make openssl swtpm tpm2-tools \ | ||
libcryptsetup-dev libgpgme-dev libcap-dev qemu-kvm \ | ||
libdevmapper-dev libacl1-dev libarchive-tools pip python3-yaml \ | ||
sbsigntool squashfs-tools wget | ||
pip install virt-firmware | ||
mv /usr/lib/go /usr/lib/go.no || true | ||
cd /tmp/ | ||
wget https://go.dev/dl/go1.21.0.linux-arm64.tar.gz | ||
tar -C /usr/lib -zvxf go1.21.0.linux-arm64.tar.gz | ||
rm /usr/bin/go /usr/bin/gofmt | ||
ln -s /usr/lib/go/bin/go /usr/bin/go | ||
ln -s /usr/lib/go/bin/gofmt /usr/bin/gofmt | ||
run: | | ||
git config --global --add safe.directory /home/runner/work/mos/mos | ||
pwd | ||
git describe --always --dirty | ||
go version | ||
make | ||
make test-trust | ||
- name: Rename Binary | ||
run: | | ||
mv mosb mosb-linux-arm64 | ||
mv mosctl mosctl-linux-arm64 | ||
mv trust trust-linux-arm64 | ||
- name: release | ||
uses: softprops/action-gh-release@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
trust-linux-arm64 | ||
mosb-linux-arm64 | ||
mosctl-linux-arm64 |