Skip to content

release 0.5.1

release 0.5.1 #29

Workflow file for this run

name: Release
on:
push:
tags:
# x.y.z version format
- "[0-9]+.[0-9]+.[0-9]+"
env:
CARGO_TERM_COLOR: always
jobs:
create-release:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Get the release version from the tag
run: |
echo "DRA_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: Print release version
run: |
echo "Version is: $DRA_VERSION"
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./scripts/create-github-release.sh "$DRA_VERSION"
# NOTE: always set shell: bash, otherwise on Windows there might be problems!
build:
name: ${{ matrix.job.os }}
needs: [ create-release ]
runs-on: ${{ matrix.job.runner }}
strategy:
fail-fast: false
matrix:
job:
- os: linux
runner: ubuntu-22.04
target: x86_64-unknown-linux-gnu
use-cross: false
- os: linux-musl
runner: ubuntu-22.04
target: x86_64-unknown-linux-musl
use-cross: true
- os: linux-armv6
runner: ubuntu-22.04
target: arm-unknown-linux-gnueabihf
use-cross: true
- os: linux-arm64
runner: ubuntu-22.04
target: aarch64-unknown-linux-gnu
use-cross: true
- os: macos
runner: macos-latest
target: x86_64-apple-darwin
use-cross: false
- os: macos-arm64
runner: macos-latest
target: aarch64-apple-darwin
use-cross: false
- os: windows
runner: windows-latest
target: x86_64-pc-windows-msvc
use-cross: false
steps:
- uses: actions/checkout@v4
- name: Get the release version from the tag
shell: bash
run: |
echo "DRA_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: Install prerequisites
shell: bash
run: |
case ${{ matrix.job.os }} in
linux-armv6) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
linux-arm64) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
esac
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: "${{ matrix.job.target }}"
- uses: taiki-e/install-action@v2
if: matrix.job.use-cross == true
with:
tool: cross
- name: Setup build tools
if: matrix.job.use-cross == true
shell: bash
run: |
echo "CARGO_BIN=cross" >>$GITHUB_ENV
- name: Export cargo target
shell: bash
run: echo "CARGO_TARGET=${{ matrix.job.target }}" >>$GITHUB_ENV
- name: Build release binary
shell: bash
run: make release
- name: Build archive
id: build_archive
shell: bash
run: |
asset=$(./scripts/create-release-archive.sh "$DRA_VERSION" "${{ matrix.job.os }}" "$CARGO_TARGET")
echo "ARCHIVE=$asset" >> $GITHUB_OUTPUT
- name: Upload assets
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
./scripts/upload-github-release-assets.sh \
"$DRA_VERSION" \
${{ steps.build_archive.outputs.ARCHIVE }}
- name: Build and upload debian package
if: matrix.job.os == 'linux'
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cargo install cargo-deb
deb_file=$(./scripts/create-deb.sh "$CARGO_TARGET")
./scripts/upload-github-release-assets.sh "$DRA_VERSION" "$deb_file"