chore: upgrade actions (#255) #164
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
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 |