-
Notifications
You must be signed in to change notification settings - Fork 15
105 lines (85 loc) · 3.31 KB
/
release_linux.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: "Building release binaries on Linux"
on: [push]
jobs:
Ubuntu1804-Build:
name: Ubuntu1804
runs-on: ubuntu-18.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build binary
run: |
set -e -o pipefail
set -x
mkdir -p artifact/yubihsm-connector
sudo apt-get update && sudo apt-get dist-upgrade -y
sudo apt-get install -y libusb-1.0.0-dev
export PATH=$PATH:/usr/local/go/bin:~/go/bin
if [[ ! -x $(command -v go ) ]]; then
curl -L --max-redirs 2 -o - https://golang.org/dl/go1.17.linux-amd64.tar.gz |\
sudo tar -C /usr/local -xzvf -
fi
if [[ ! -x $(command -v go-bin-deb) ]]; then
curl -L -o go-bin-deb.dpkg https://github.com/mh-cbon/go-bin-deb/releases/download/0.0.19/go-bin-deb-amd64.deb
sudo dpkg -i go-bin-deb.dpkg
sudo apt-get install --fix-missing
fi
make
strip --strip-all bin/yubihsm-connector
version=`bin/yubihsm-connector version`
go-bin-deb generate -f deb/deb.json -a amd64 --version=${version}-1
cp *.deb artifact/yubihsm-connector
./bin/yubihsm-connector version
./bin/yubihsm-connector --help
LICESE_DIR="artifact/yubihsm-connector/share/yubihsm-connector"
mkdir -p $LICESE_DIR
cp -r resources/release/licenses $LICESE_DIR/
for lf in $LICESE_DIR/licenses/*; do
chmod 644 $lf
done
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: yubihsm-connector-ubuntu1804-amd64
path: artifact
Ubuntu2004-Build:
name: Ubuntu2004
runs-on: ubuntu-20.04
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Build binary
run: |
set -e -o pipefail
set -x
mkdir -p artifact/yubihsm-connector
sudo apt-get update && sudo apt-get dist-upgrade -y
sudo apt-get install -y libusb-1.0.0-dev
export PATH=$PATH:/usr/local/go/bin:~/go/bin
if [[ ! -x $(command -v go ) ]]; then
curl -L --max-redirs 2 -o - https://golang.org/dl/go1.17.linux-amd64.tar.gz |\
sudo tar -C /usr/local -xzvf -
fi
if [[ ! -x $(command -v go-bin-deb) ]]; then
curl -L -o go-bin-deb.dpkg https://github.com/mh-cbon/go-bin-deb/releases/download/0.0.19/go-bin-deb-amd64.deb
sudo dpkg -i go-bin-deb.dpkg
sudo apt-get install --fix-missing
fi
make
strip --strip-all bin/yubihsm-connector
version=`bin/yubihsm-connector version`
go-bin-deb generate -f deb/deb.json -a amd64 --version=${version}-1
cp *.deb artifact/yubihsm-connector
./bin/yubihsm-connector version
./bin/yubihsm-connector --help
LICESE_DIR="artifact/yubihsm-connector/share/yubihsm-connector"
mkdir -p $LICESE_DIR
cp -r resources/release/licenses $LICESE_DIR/
for lf in $LICESE_DIR/licenses/*; do
chmod 644 $lf
done
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: yubihsm-connector-ubuntu2004-amd64
path: artifact