Skip to content

chore: Release

chore: Release #83

Workflow file for this run

name: release
on:
push:
tags: ["jql-v[0-9]+.[0-9]+.[0-9]+*"]
jobs:
performance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: "main"
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Install hyperfine and jql - jq is already available!
run: cargo install hyperfine && cargo install jql
- name: Run performance benchmarks
run: ./performance.sh
- name: Create pull-request
uses: peter-evans/create-pull-request@v5
with:
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
body: Update PERFORMANCE.md file
branch: performance
commit-message: "chore(performance): update benchmarks"
committer: GitHub <noreply@github.com>
delete-branch: true
labels: enhancement
reviewers: yamafaktory
title: "[Performance] Update benchmarks"
token: ${{ secrets.GITHUB_TOKEN }}
build-release:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
archive: tar.gz
archive-cmd: tar czf
sha-cmd: sha256sum
- os: ubuntu-latest
target: aarch64-unknown-linux-musl
archive: tar.gz
archive-cmd: tar czf
sha-cmd: sha256sum
- os: ubuntu-latest
target: arm-unknown-linux-musleabihf
archive: tar.gz
archive-cmd: tar czf
sha-cmd: sha256sum
# Darwin
- os: macos-latest
target: x86_64-apple-darwin
archive: zip
archive-cmd: zip -r
sha-cmd: shasum -a 256
- os: macos-latest
target: aarch64-apple-darwin
archive: zip
archive-cmd: zip -r
sha-cmd: shasum -a 256
# Windows
- os: windows-latest
target: x86_64-pc-windows-msvc
archive: zip
archive-cmd: 7z a
sha-cmd: sha256sum
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
target: ${{ matrix.target }}
toolchain: stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: |
cargo install cross --git https://github.com/cross-rs/cross
cross build --release --target ${{ matrix.target }}
- name: Package Artifacts
shell: bash
run: |
src=$(pwd)
stage=$(mktemp -d)
ver=${GITHUB_REF#refs/tags/}
asset_name="$ver-${{ matrix.target }}.${{ matrix.archive }}"
ASSET_PATH="$src/$asset_name"
CHECKSUM_PATH="$ASSET_PATH.sha256"
cp target/${{ matrix.target }}/release/jql $stage/
cd $stage
${{ matrix.archive-cmd }} $ASSET_PATH *
cd $src
${{ matrix.sha-cmd }} $asset_name > $CHECKSUM_PATH
if [ "$RUNNER_OS" == "Windows" ]; then
echo "ASSET_PATH=$(cygpath -m $ASSET_PATH)" >> $GITHUB_ENV
echo "CHECKSUM_PATH=$(cygpath -m $CHECKSUM_PATH)" >> $GITHUB_ENV
else
echo "ASSET_PATH=$ASSET_PATH" >> $GITHUB_ENV
echo "CHECKSUM_PATH=$CHECKSUM_PATH" >> $GITHUB_ENV
fi
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
fail_on_unmatched_files: true
files: |
${{ env.ASSET_PATH }}
${{ env.CHECKSUM_PATH }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}