Build vet #3
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: Build vet | |
on: | |
workflow_dispatch: | |
inputs: | |
vet-version: | |
description: 'vet version' | |
# required: false | |
default: 'vX.Y.Z-beta.U' | |
jobs: | |
build_vet_linux: | |
name: Build vet linux | |
strategy: | |
matrix: | |
include: | |
- os: 'ubuntu-24.04' | |
runs-on: 'ubicloud' | |
build_type: Release | |
GOOS: linux | |
GOARCH: amd64 | |
rust-image: 'ed7795c6eaccae53be35939e883e8c3de0197b21e8eddbd9f04b0c4bc757c094' | |
target: x86_64-unknown-linux-musl | |
- os: 'ubuntu-24.04' | |
runs-on: 'ubicloud-standard-2-arm' | |
build_type: Release | |
GOOS: linux | |
GOARCH: arm64 | |
rust-image: 'c428882ff081342a9661fb13a1d059ecdc0b6e979ffec64b80371cf20a2088b0' | |
target: aarch64-unknown-linux-musl | |
runs-on: ${{ matrix.runs-on }} | |
outputs: | |
vet-checksum: ${{steps.vet.outputs.checksum}} | |
steps: | |
- name: echo | |
run: | | |
echo vet-version ${{github.event.inputs.vet-version}} | |
- name: setup rust | |
run: rustup update && rustup target add ${{ matrix.target }} | |
- name: clone | |
run: rm -rf vet && git clone https://github.com/marlinprotocol/vet | |
- name: checkout | |
run: cd vet && git checkout master | |
- name: build | |
run: cd vet && sudo docker run --rm -v `pwd`:/code rust@sha256:${{matrix.rust-image}} /code/build-${{matrix.GOARCH}}.sh | |
- name: upx | |
run: | | |
wget https://github.com/upx/upx/releases/download/v4.2.4/upx-4.2.4-${{matrix.GOARCH}}_linux.tar.xz -O upx.txz | |
mkdir -p upx && tar -xvf upx.txz --strip-components=1 -C upx | |
sudo mv upx/upx /usr/local/bin/ | |
- name: upload vet | |
id: vet | |
if: ${{github.event.inputs.vet-version != 'vX.Y.Z-beta.U'}} | |
run: | | |
sudo upx vet/target/${{ matrix.target }}/release/vet | |
echo "::set-output name=checksum::$(sha256sum vet/target/${{ matrix.target }}/release/vet | awk '{print $1;}')" | |
AWS_ACCESS_KEY_ID=${{secrets.AWS_ACCESS_KEY_ID}} AWS_SECRET_ACCESS_KEY=${{secrets.AWS_SECRET_ACCESS_KEY}} aws s3 cp --endpoint-url ${{secrets.AWS_S3_ENDPOINT}} vet/target/${{ matrix.target }}/release/vet s3://artifacts/oyster/binaries/vet_${{github.event.inputs.vet-version}}_${{matrix.GOOS}}_${{matrix.GOARCH}} |