ci(fix): some errors #7
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-20.04 | |
target: x86_64-unknown-linux-gnu | |
deb: true | |
- os: ubuntu-20.04 | |
target: aarch64-unknown-linux-gnu | |
deb: true | |
- os: windows-latest | |
target: x86_64-pc-windows-gnu | |
deb: false | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
deb: false | |
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) | |
if: contains(matrix.platform.os, 'ubuntu') | |
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: | | |
*.exe | |
*.deb | |
*.tar.gz | |
*.zip | |
- name: Create release | |
uses: softprops/action-gh-release@v1 | |
with: | |
draft: true | |
files: | | |
prqlite* | |
LICENSE | |
name: ${{ steps.get_version.outputs.value }} |