Skip to content

Commit

Permalink
Create deployment workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kerristrasz committed Jun 26, 2024
1 parent 3a4096b commit 1c2e659
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 29 deletions.
58 changes: 29 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ name: Build
on:
push:
branches:
- master
- master
pull_request:
branches:
- master
- master

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"
Expand All @@ -19,14 +19,14 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- name: Run tests
run: cargo test
- name: Run tests (preserve_order)
run: cargo test --features preserve_order
- uses: actions/checkout@v4
- name: Run tests
run: cargo test
- name: Run tests (preserve_order)
run: cargo test --features preserve_order

build:
name: Build (${{matrix.os}})
Expand All @@ -35,37 +35,37 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@v4
- name: Check
run: cargo check
- name: Check (preserve_order)
run: cargo check --features preserve_order
# - name: Check (no-std)
# run: cargo check --no-default-features
- uses: actions/checkout@v4
- name: Check
run: cargo check
- name: Check (preserve_order)
run: cargo check --features preserve_order
# - name: Check (no-std)
# run: cargo check --no-default-features

clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run Clippy
run: cargo clippy --all-targets
- uses: actions/checkout@v4
- name: Run Clippy
run: cargo clippy --all-targets

format:
name: Check formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run rustfmt
run: cargo fmt -- --check
- uses: actions/checkout@v4
- name: Run rustfmt
run: cargo fmt -- --check

docs:
name: Check documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run cargo doc
run: cargo doc --no-deps --workspace
- uses: actions/checkout@v4
- name: Run cargo doc
run: cargo doc --no-deps --workspace
32 changes: 32 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build
on:
create:
tags:
- "v*"

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"

jobs:
release:
name: Create GitHub release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false

publish:
name: Publish to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: cargo publish --verbose --token ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit 1c2e659

Please sign in to comment.