-
Notifications
You must be signed in to change notification settings - Fork 63
54 lines (47 loc) · 1.75 KB
/
release_latest.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
name: Release latest binary
on:
push:
branches:
- main
jobs:
run:
name: Upload
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64]
runs-on: ${{ fromJson('{"amd64":"ubuntu-latest", "arm64":["self-hosted", "Linux", "ARM64"]}')[matrix.arch] }}
# glibc version 2.17
container: ${{ fromJson('{"amd64":"docker.io/centos:7.2.1511", "arm64":"docker.io/centos:centos7"}')[matrix.arch] }}
steps:
- name: Set up Go 1.18
uses: actions/setup-go@v4
with:
go-version: 1.18.2
id: go
- name: Prepare build environment
run: |
# actions/checkout require git v2.X
yum install -y gcc make binutils centos-release-scl
yum install -y rh-git227-git
echo /opt/rh/rh-git227/root/usr/bin >> $GITHUB_PATH
echo "LD_LIBRARY_PATH=/opt/rh/httpd24/root/usr/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup python3
run: |
yum install -y python3
alias python=python3
- name: Configure awscli
run: |
pip3 install awscli
printf "%s\n" ${{ secrets.AWS_ACCESS_KEY }} ${{ secrets.AWS_SECRET_KEY }} ${{ secrets.AWS_REGION }} "json" | aws configure
- name: Build binary and related tools
run: make build
# TODO: release on github package / release
- name: Upload files
run: |
mv bin chaosd-latest-linux-${{ matrix.arch }}
tar czvf chaosd-latest-linux-${{ matrix.arch }}.tar.gz chaosd-latest-linux-${{ matrix.arch }}
aws s3 cp chaosd-latest-linux-${{ matrix.arch }}.tar.gz ${{ secrets.AWS_BUCKET_NAME }}/chaosd-latest-linux-${{ matrix.arch }}.tar.gz