This repository has been archived by the owner on Sep 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
82 lines (79 loc) · 2.47 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
on:
push:
pull_request:
name: build
jobs:
build_amd64:
name: build on ubuntu-22.04 amd64
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up golang
uses: actions/setup-go@v2
with:
go-version: 1.21
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install bats golang make openssl swtpm tpm2-tools \
libcryptsetup-dev libgpgme-dev libcap-dev qemu-kvm \
libdevmapper-dev libacl1-dev libarchive-tools pip squashfs-tools \
sbsigntool
pip install virt-firmware
- name: lint
run: |
make gofmt
- name: build
run: |
make
- name: test
run: |
make test
- name: Rename Binary
run: |
mv trust trust-linux-amd64
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: trust-linux-amd64
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 golang make openssl swtpm tpm2-tools \
libcryptsetup-dev libgpgme-dev libcap-dev qemu-kvm \
libdevmapper-dev libacl1-dev libarchive-tools pip squashfs-tools \
sbsigntool 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/trust/trust
pwd
git describe --always --dirty
go version
make
make test
- name: Rename Binary
run: |
mv trust trust-linux-arm64
- name: release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: trust-linux-arm64