This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
347: Libp2p Upgrade #6
Workflow file for this run
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: Releaser | |
on: | |
push: | |
branches-ignore: | |
- '**' | |
tags: | |
- 'v*.*.*' | |
- 'v*.*.*-*' | |
jobs: | |
binary_linux_amd64: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install cargo deps and build avail | |
shell: bash | |
run: | | |
curl https://sh.rustup.rs -sSf | sh -s -- -y | |
source "$HOME/.cargo/env" | |
sudo apt-get update && sudo apt-get install -y protobuf-compiler | |
cargo build -p avail-light-bootstrap --release | |
mv target/release/avail-light-bootstrap target/release/avail-light-bootstrap-linux-amd64 | |
pushd target/release/ | |
tar czf avail-light-bootstrap-linux-amd64.tar.gz avail-light-bootstrap-linux-amd64 | |
popd | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: avail-light-bootstrap-linux-amd64-binary | |
path: target/release/avail-light-bootstrap-linux-amd64.tar.gz | |
binary_linux_aarch64: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install cargo deps and build avail | |
shell: bash | |
run: | | |
curl https://sh.rustup.rs -sSf | sh -s -- -y | |
source "$HOME/.cargo/env" | |
rustup target add aarch64-unknown-linux-gnu | |
sudo apt-get update && sudo apt-get install -y musl-tools clang gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libc6-dev libc6-dev-arm64-cross libssl-dev pkg-config librust-openssl-dev build-essential protobuf-compiler | |
env BINDGEN_EXTRA_CLANG_ARGS='--sysroot /usr/aarch64-linux-gnu' CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc cargo build --profile release --target=aarch64-unknown-linux-gnu -p avail-light-bootstrap | |
mv target/aarch64-unknown-linux-gnu/release/avail-light-bootstrap target/aarch64-unknown-linux-gnu/release/avail-light-bootstrap-linux-aarch64 | |
pushd target/aarch64-unknown-linux-gnu/release/ | |
tar czf avail-light-bootstrap-linux-aarch64.tar.gz avail-light-bootstrap-linux-aarch64 | |
popd | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: avail-light-bootstrap-linux-aarch64-binary | |
path: target/aarch64-unknown-linux-gnu/release/avail-light-bootstrap-linux-aarch64.tar.gz | |
binary_apple_arm64: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install cargo deps and build avail | |
shell: bash | |
run: | | |
curl https://sh.rustup.rs -sSf | sh -s -- -y | |
source "$HOME/.cargo/env" | |
rustup target add aarch64-apple-darwin | |
cargo build --profile release -p avail-light-bootstrap | |
mv target/release/avail-light-bootstrap target/release/avail-light-bootstrap-apple-arm64 | |
pushd target/release/ | |
tar czf avail-light-bootstrap-apple-arm64.tar.gz avail-light-bootstrap-apple-arm64 | |
popd | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: avail-light-bootstrap-apple-arm64-binary | |
path: target/release/avail-light-bootstrap-apple-arm64.tar.gz | |
# can extend binary publish 'needs' to include more releases i.e. arm64 in future | |
binary_publish: | |
needs: [binary_linux_amd64, binary_linux_aarch64, binary_apple_arm64] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v2 | |
with: | |
name: avail-light-bootstrap-linux-amd64-binary | |
- uses: actions/download-artifact@v2 | |
with: | |
name: avail-light-bootstrap-linux-aarch64-binary | |
- uses: actions/download-artifact@v2 | |
with: | |
name: avail-light-bootstrap-apple-arm64-binary | |
- name: Prepare | |
id: prepare | |
run: | | |
TAG=${GITHUB_REF#refs/tags/} | |
echo ::set-output name=tag_name::${TAG} | |
- name: publish binaries | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.PAT_TOKEN }} | |
file: /home/runner/work/avail-light-bootstrap/avail-light-bootstrap/avail-light-bootstrap* | |
release_name: ${{ steps.prepare.outputs.tag_name }} | |
tag: ${{ steps.prepare.outputs.tag_name }} | |
overwrite: true | |
file_glob: true |