Skip to content

Commit

Permalink
add build and release ci config
Browse files Browse the repository at this point in the history
  • Loading branch information
digizeph committed Feb 3, 2024
1 parent b77a7e0 commit ca9fbb9
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build

on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
pull_request:
branches: [ main ]
paths-ignore:
- '**.md'

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build default
run: cargo build
- name: Run format check
run: cargo fmt --check
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release

permissions:
contents: write

on:
push:
tags:
- v[0-9]+.*

jobs:
build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --verbose
- name: cargo fmt test
run: cargo fmt --check

create-release:
needs: build-test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
# (optional) Path to changelog.
changelog: CHANGELOG.md
# (required) GitHub token for creating GitHub Releases.
token: ${{ secrets.GITHUB_TOKEN }}

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

0 comments on commit ca9fbb9

Please sign in to comment.