Skip to content

doc: add CHANGELOG for v0.2.0 #6

doc: add CHANGELOG for v0.2.0

doc: add CHANGELOG for v0.2.0 #6

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
target_dir: target/x86_64-unknown-linux-gnu/release
binary_name: docq
- os: macos-latest
target: aarch64-apple-darwin
target_dir: target/aarch64-apple-darwin/release
binary_name: docq
- os: windows-latest
target: x86_64-pc-windows-msvc
target_dir: target/x86_64-pc-windows-msvc/release
binary_name: docq.exe
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Add Rust target
run: rustup target add ${{ matrix.target }}
- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
- name: Build release binary
run: cargo build --release --all-features --locked --target ${{ matrix.target }}
- name: Package binary
shell: bash
run: |
mkdir -p dist
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
cp "${{ matrix.target_dir }}/${{ matrix.binary_name }}" "dist/docq-${{ matrix.target }}.exe"
else
cp "${{ matrix.target_dir }}/${{ matrix.binary_name }}" "dist/docq-${{ matrix.target }}"
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docq-${{ matrix.target }}
path: dist/*
if-no-files-found: error
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate changelog
uses: orhun/git-cliff-action@v4
with:
config: cliff.toml
args: --tag ${{ github.ref_name }}
env:
OUTPUT: CHANGELOG.md
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Create Release
uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
files: dist/*
generate_release_notes: false