Skip to content

test infra repo dispatch #17

test infra repo dispatch

test infra repo dispatch #17

Workflow file for this run

name: Optimize Build
on:
push:
branches:
- '**'
jobs:
build:
if: false
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-20.04
workspace: avail-light
rust_target: x86_64-unknown-linux-gnu
output_name: avail-light-linux-amd64
extra_setup: ""
- os: ubuntu-20.04
workspace: avail-light
rust_target: aarch64-unknown-linux-gnu
output_name: avail-light-linux-arm64
extra_setup: |
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
rustup target add aarch64-unknown-linux-gnu
export BINDGEN_EXTRA_CLANG_ARGS='--sysroot /usr/aarch64-linux-gnu'
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/usr/bin/aarch64-linux-gnu-gcc
- os: macos-14
workspace: avail-light
rust_target: aarch64-apple-darwin
output_name: avail-light-apple-arm64
extra_setup: |
rustup target add aarch64-apple-darwin
- os: macos-13
workspace: avail-light
rust_target: x86_64-apple-darwin
output_name: avail-light-apple-x86_64
extra_setup: |
rustup target add x86_64-apple-darwin
steps:
- uses: actions/checkout@v4
- name: Install cargo and setup
shell: bash
run: |
sudo apt-get update && sudo apt-get install -y librust-openssl-dev build-essential protobuf-compiler musl-tools clang libc6-dev libc6-dev-arm64-cross libssl-dev pkg-config
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "$HOME/.cargo/env"
- name: Build ${{ matrix.output_name }}
shell: bash
run: |
${{ matrix.extra_setup }}
cargo build --profile maxperf --target=${{ matrix.rust_target }} -p ${{ matrix.workspace }}
mv target/${{ matrix.rust_target }}/maxperf/${{ matrix.workspace }} target/${{ matrix.rust_target }}/maxperf/${{ matrix.output_name }}
pushd target/${{ matrix.rust_target }}/maxperf/
tar czf ${{ matrix.output_name }}.tar.gz ${{ matrix.output_name }}
popd
- uses: actions/upload-artifact@v4
with:
name: binaries
path: target/${{ matrix.rust_target }}/maxperf/${{ matrix.output_name }}.tar.gz
binary_publish:
needs: [build]
runs-on: ubuntu-20.04
steps:
- uses: actions/download-artifact@v4
with:
path: binaries
pattern: avail-light-*
merge-multiple: true
- run: ls -R binaries
- name: Prepare
id: prepare
run: |
TAG=${GITHUB_REF#refs/tags/}
echo ::set-output name=tag_name::${TAG}
trigger_deploy_workflow:
runs-on: ubuntu-latest
steps:
- name: Extract tag name
id: extract_tag
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Trigger repository_dispatch
shell: bash
run: |
curl -s -o /dev/null -w "%{http_code}" \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.PAT_TOKEN }}" \
https://api.github.com/repos/availproject/avail-light-infra/dispatches \
-d '{"event_type": "binary_release", "client_payload": {"avail_light_version": "refs/heads/ob/gh-workflow"}}'
trigger_crawler_build:
runs-on: ubuntu-20.04
steps:
- name: Extract tag name
id: extract_tag
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Trigger repository dispatch for crawler build
shell: bash
run: |
curl -s -o /dev/null -w "%{http_code}" \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.PAT_TOKEN }}" \
${{ secrets.CRAWLER_BUILD_URL}} \
-d "{\"event_type\": \"lc_crawler_build\", \"client_payload\": {\"tag\": \"${{ env.TAG_NAME }}\"}}" \
| grep -q "204"