Skip to content

Build and release binaries #15

Build and release binaries

Build and release binaries #15

Workflow file for this run

name: Build and release binaries
on:
release:
types: [created]
workflow_dispatch:
jobs:
release:
if: startsWith(github.ref, 'refs/tags/v')
name: Build and Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
asset_name: bigtools-linux-gnu-noremote
remote: false
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
asset_name: bigtools-linux-gnu
remote: true
- os: windows-msvc-latest
target: x86_64-pc-windows-msvc
asset_name: bigtools-windows-msvc
remote: true
- os: macos-latest
target: x86_64-apple-darwin
asset_name: bigtools-apple-darwin
remote: true
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build project
run: |
rustup target add ${{ matrix.target }}
cargo build --release --locked --target ${{ matrix.target }} --no-default-features ${{ matrix.remote && '--features remote' || '' }}
- name: Zip build artifacts
uses: papeloto/action-zip@v1
with:
files: |
target/release/bedgraphtobigwig;
target/release/bedtobigbed;
target/release/bigbedinfo;
target/release/bigbedtobed;
target/release/bigtools;
target/release/bigwigaverageoverbed;
target/release/bigwiginfo;
target/release/bigwigmerge;
target/release/bigwigtobedgraph;
target/release/bigwigvaluesoverbed
dest: ${{ matrix.asset_name }}.zip
- name: Zip upload
uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ github.workspace }}/${{ matrix.asset_name }}.zip
- name: Cargo publish
uses: katyo/publish-crates@v2
with:
path: './bigtools'
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}