Skip to content

Build For Release

Build For Release #6

name: Build For Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
publish:
name: Create Github Release
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-gnu
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
archive: tar.gz
cross: false
strip: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Bootstrap
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
- name: Cache Dependencies
uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}
- name: Pack Artifacts
env:
RELEASE_NAME: dagtoc-${{ matrix.target }}
ARTIFACTS_DIR: target/${{ matrix.target }}/release
run: |
mkdir $RELEASE_NAME
cp $ARTIFACTS_DIR/dagtoc -t $RELEASE_NAME
cp -r completions -t $RELEASE_NAME
cp README.md LICENSE -t $RELEASE_NAME
tar -zcvf $RELEASE_NAME.${{ matrix.archive }} -C $RELEASE_NAME .
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: dagtoc-${{ matrix.target }}.${{ matrix.archive }}