Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Build

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2

- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run clippy
run: cargo clippy --all-targets --all-features -- -D warnings
- name: Check formatting
run: cargo fmt --check
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release

on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"

permissions:
contents: write

jobs:
build-and-upload:
name: Build and upload
runs-on: ${{ matrix.os }}

strategy:
matrix:
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- build: macos-intel
os: macos-latest
target: x86_64-apple-darwin
- build: macos-arm
os: macos-latest
target: aarch64-apple-darwin

steps:
- name: Checkout
uses: actions/checkout@v4

- uses: Swatinem/rust-cache@v2

- name: Get the release version from the tag
shell: bash
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Build
run: cargo build --verbose --release --target ${{ matrix.target }}

- name: Build archive
shell: bash
run: |
binary_name="tabbs"
dirname="$binary_name-${{ env.VERSION }}-${{ matrix.target }}"
mkdir "$dirname"
mv "target/${{ matrix.target }}/release/$binary_name" "$dirname"
tar -czf "$dirname.tar.gz" "$dirname"
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV

- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
${{ env.ASSET }}
22 changes: 0 additions & 22 deletions .github/workflows/rust.yml

This file was deleted.

Loading