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
35 changes: 35 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
on: [push, pull_request]

name: CI

jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build project
run: cargo build --locked

test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test

fmt:
name: fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check

45 changes: 0 additions & 45 deletions .github/workflows/ci.yml

This file was deleted.

57 changes: 57 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release

on:
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Create new release
run: |
cargo install cargo-extract
VERSION=v$(cargo extract package.version)
echo "Creating release: ${VERSION}"
gh release create ${VERSION} --title ${VERSION}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

upload-assets:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: windows-latest
extension: ".exe"

name: Upload assets for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
needs: release

steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release --locked
- name: Upload binary
shell: bash
run: |
cargo install cargo-extract
CRATE_NAME=$(cargo extract package.name)
CRATE_VERSION=v$(cargo extract package.version)
ARCH_TRIPLE=$(cargo extract --arch)

OUTPUT_FILENAME="${CRATE_NAME}-${ARCH_TRIPLE}${{ matrix.extension }}"
mv "target/release/${CRATE_NAME}${{ matrix.extension }}" "$OUTPUT_FILENAME"

echo "${CRATE_NAME}@{CRATE_VERSION} (${ARCH_TRIPLE})"
echo "Uploading ${OUTPUT_FILENAME}..."

gh release upload ${CRATE_VERSION} ${OUTPUT_FILENAME}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 0 additions & 44 deletions .github/workflows/release.yml

This file was deleted.

1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/target
**/*.rs.bk
Loading