Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mstruebing committed Feb 21, 2023
0 parents commit 15e5b45
Show file tree
Hide file tree
Showing 14 changed files with 1,035 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI
on:
push:
branches:
- main
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- uses: actions-rs/toolchain@v1
id: toolchain
with:
profile: minimal
toolchain: stable
components: clippy, rustfmt

- name: Check
uses: actions-rs/cargo@v1
with:
command: check

- name: Fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features -- -D warnings

- name: Build
uses: actions-rs/cargo@v1
with:
command: build

- name: Test
uses: actions-rs/cargo@v1
with:
command: test
args: --all-features --no-fail-fast
11 changes: 11 additions & 0 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Lint Commit Messages
on: [pull_request]

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v3
29 changes: 29 additions & 0 deletions .github/workflows/generate-changelog.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI - Changelog

on:
push:
branches: [main]

jobs:
changelog_prerelease:
name: Update Changelog For Prerelease
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: main
- name: Update Changelog
uses: heinrichreimer/github-changelog-generator-action@v2.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
issues: true
issuesWoLabels: true
pullRequests: true
prWoLabels: true
unreleased: true
addSections: '{"documentation":{"prefix":"**Documentation:**","labels":["documentation"]}}'
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update Changelog for PR
file_pattern: CHANGELOG.md
65 changes: 65 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Release
on:
push:
tags:
- "*.*.*"

env:
CARGO_TERM_COLOR: always

jobs:
release-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build
run: |
cargo build --release --target x86_64-unknown-linux-gnu
mv target/x86_64-unknown-linux-gnu/release/sback ./sback
chmod +x sback
tar -czf sback-linux-x86_64.tar.gz sback
rm sback
rustup target add x86_64-unknown-linux-musl
cargo build --release --target x86_64-unknown-linux-musl
mv target/x86_64-unknown-linux-musl/release/sback ./sback
chmod +x sback
tar -czf sback-alpine-x86_64.tar.gz sback
- name: Publish release
uses: softprops/action-gh-release@v1
with:
files: sback-*
draft: true
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release-darwin:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Build
run: |
cargo build --release --target x86_64-apple-darwin
mv target/x86_64-apple-darwin/release/sback ./sback
chmod +x sback
tar -czf sback-darwin-x86_64.tar.gz sback
- name: Publish release
uses: softprops/action-gh-release@v1
with:
files: sback-*
draft: true
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release-crate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build and publish to crates.io
run: |
cargo login ${{ secrets.CRATES_TOKEN }}
cargo publish
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 15e5b45

Please sign in to comment.