Skip to content

Merge pull request #46 from gregjoy1/negative-query-docs #34

Merge pull request #46 from gregjoy1/negative-query-docs

Merge pull request #46 from gregjoy1/negative-query-docs #34

Workflow file for this run

name: Build Release
on:
# This workflow is run each time a tag is pushed.
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
permissions:
contents: write
jobs:
build-and-upload:
name: Build and upload
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- build: x86-64-linux-gnu
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
use-cross: false
rustflags: ""
# No need for this yet - enable when actually needed.
#
# - build: arm64-linux-gnu
# os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
# use-cross: true
# rustflags: ""
- build: x86-64-linux-musl
os: ubuntu-latest
target: x86_64-unknown-linux-musl
use-cross: false
rustflags: "-C target-feature=-crt-static"
- build: x86-64-macos
os: macos-latest
target: x86_64-apple-darwin
use-cross: false
rustflags: ""
- build: arm64-macos
os: macos-latest
target: aarch64-apple-darwin
use-cross: false
rustflags: ""
steps:
- name: Checkout
uses: actions/checkout@v3
- if: ${{ contains(matrix.target, '-musl') && contains(matrix.os, 'ubuntu-latest') }}
name: Install musl-tools
shell: bash
run: sudo apt-get install musl-tools
- name: Get the release version from the tag or workflow dispatch
shell: bash
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: ${{ matrix.rustflags }}
with:
use-cross: ${{ matrix.use-cross }}
command: build
args: --verbose --release --target ${{ matrix.target }}
- name: Build archive
shell: bash
run: |
# Replace with the name of your binary
binary_name="libredical"
dirname="$binary_name-${{ env.VERSION }}-${{ matrix.target }}"
mkdir "$dirname"
if [ "${{ matrix.os }}" = "macos-latest" ]; then
mv "target/${{ matrix.target }}/release/$binary_name.dylib" "$dirname"
else
mv "target/${{ matrix.target }}/release/$binary_name.so" "$dirname"
fi
tar -czf "$dirname.tar.gz" "$dirname"
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.ASSET }}