Skip to content

Release

Release #5

Workflow file for this run

name: Release
permissions:
contents: write
on:
push:
tags:
- v[0-9]+.*
env:
CARGO_INCREMENTAL: 0
jobs:
release:
name: ${{ matrix.target }}
permissions:
contents: write
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
deb: true
- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
deb: true
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get version
id: get_version
uses: SebRollen/[email protected]
with:
file: Cargo.toml
field: package.version
- name: Set artifact name
shell: bash
run: |
version="$(git describe --tags --match='v*' --always)"
name="prqlite-$version-${{ matrix.target }}"
echo "ARTIFACT_NAME=$name" >> $GITHUB_ENV
echo "version: $version"
echo "artifact: $name"
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Setup cache
uses: Swatinem/rust-cache@v1
- name: Build binary
uses: actions-rs/cargo@v1
with:
command: build
args: --release --locked --target=${{ matrix.target }} --color=always --verbose
use-cross: ${{ runner.os == 'Linux' }}
- name: Install cargo-deb
if: ${{ matrix.deb == true }}
uses: actions-rs/[email protected]
with:
crate: cargo-deb
- name: Build deb
if: ${{ matrix.deb == true }}
uses: actions-rs/cargo@v1
with:
command: deb
args: --no-build --no-strip --output=. --target=${{ matrix.target }}
- name: Package (*nix)
run: >
echo "install -Dm755 ./prqlite /usr/bin" > "install.sh" &&
tar -cv
install.sh LICENSE README.md ./docs/
-C target/${{ matrix.target }}/release/ prqlite
| gzip --best
> 'prqlite-${{ steps.get_version.outputs.value }}-${{ matrix.target }}.tar.gz'
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.target }}
path: |
*.deb
*.tar.gz
*.zip
- name: Create release
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
*.deb
*.tar.gz
*.zip
name: ${{ steps.get_version.outputs.value }}