Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ursm committed Nov 14, 2021
0 parents commit 71fe305
Show file tree
Hide file tree
Showing 18 changed files with 1,646 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/actions/cargo/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: cargo
description: Run cargo

inputs:
target:
description: toolchain.target
required: false

components:
description: toolchain.components
required: false

command:
description: cargo.command
required: true

args:
description: cargo.args
required: false

use-cross:
description: cargo.use-cross
required: false
default: 'false'

runs:
using: composite

steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly # for cargo-features = ["strip"]
target: ${{ inputs.target }}
override: true
profile: minimal
components: ${{ inputs.components }}

- uses: actions-rs/cargo@v1
with:
command: ${{ inputs.command }}
args: ${{ inputs.args }}
use-cross: ${{ inputs.use-cross }}
46 changes: 46 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on: push

jobs:
run:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: ./.github/actions/cargo
with:
command: run
args: -- --help

test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: ./.github/actions/cargo
with:
command: test

fmt:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: ./.github/actions/cargo
with:
components: rustfmt
command: fmt
args: --check

clippy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: ./.github/actions/cargo
with:
components: clippy
command: clippy
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
release:
types: [published]

jobs:
release:
strategy:
matrix:
include:
- runs-on: ubuntu-latest
target: x86_64-unknown-linux-gnu
- runs-on: ubuntu-latest
target: i686-unknown-linux-gnu
- runs-on: ubuntu-latest
target: aarch64-unknown-linux-gnu
- runs-on: ubuntu-latest
target: armv7-unknown-linux-gnueabihf
- runs-on: macos-11
target: x86_64-apple-darwin
- runs-on: macos-11
target: aarch64-apple-darwin

runs-on: ${{ matrix.runs-on }}

steps:
- uses: actions/checkout@v2

- uses: ./.github/actions/cargo
with:
target: ${{ matrix.target }}
command: build
args: --release --target ${{ matrix.target }}
use-cross: true

- run: echo "TARBALL=handlematters-${{ github.event.release.tag_name }}-${{ matrix.target }}.tar.xz" >> $GITHUB_ENV
- run: tar caf $TARBALL --directory=target/${{ matrix.target }}/release handlematters

- uses: softprops/action-gh-release@v1
with:
files: ${{ env.TARBALL }}
fail_on_unmatched_files: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
Loading

0 comments on commit 71fe305

Please sign in to comment.