Skip to content

Commit

Permalink
Add Release CI
Browse files Browse the repository at this point in the history
Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
  • Loading branch information
ggwpez committed May 13, 2024
1 parent 58e4c5d commit 51a8a37
Showing 1 changed file with 43 additions and 21 deletions.
64 changes: 43 additions & 21 deletions .github/workflows/release_binaries.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,51 @@
name: Build and Upload Release Binaries
name: Release

on:
release:
types: [published]
types:
- created
workflow_dispatch:

jobs:
release:
name: release ${{ matrix.target }}
runs-on: self-hosted
build_and_upload:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-pc-windows-gnu
archive: zip
- target: x86_64-unknown-linux-musl
archive: tar.gz tar.xz tar.zst
- target: x86_64-apple-darwin
archive: zip
platform:
- { os: ubuntu-latest, target: x86_64-unknown-linux-musl }
- { os: macos-latest, target: x86_64-apple-darwin }

runs-on: ${{ matrix.platform.os }}

steps:
- uses: actions/checkout@master
- name: Compile and release
uses: rust-build/rust-build.action@v1.4.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
RUSTTARGET: ${{ matrix.target }}
ARCHIVE_TYPES: ${{ matrix.archive }}
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- name: Add target
run: rustup target add ${{ matrix.platform.target }}

- name: Install deps for musl build
if: matrix.platform.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y musl-tools clang build-essential curl llvm-dev libclang-dev linux-headers-generic libsnappy-dev liblz4-dev libzstd-dev libgflags-dev zlib1g-dev libbz2-dev
sudo ln -s /usr/bin/g++ /usr/bin/musl-g++
- name: Build
run: cargo build --release --target ${{ matrix.platform.target }}

- name: Upload Binary to Release
uses: actions/upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./target/${{ matrix.platform.target }}/release/zepter
asset_name: zepter-${{ matrix.platform.target }}
asset_content_type: application/octet-stream
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 51a8a37

Please sign in to comment.