ci: add some basic ci/cd
This commit is contained in:
parent
6f9e7c21c8
commit
1f7f587611
1 changed files with 39 additions and 0 deletions
39
.forgejo/workflows/build-and-upload.yml
Normal file
39
.forgejo/workflows/build-and-upload.yml
Normal file
|
@ -0,0 +1,39 @@
|
|||
name: Cargo Build & Test
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build_and_test:
|
||||
name: Build and test
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
toolchain:
|
||||
- stable
|
||||
- beta
|
||||
- nightly
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Get Rust toolchain
|
||||
uses: https://github.com/dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: ${{ matrix.toolchain }}
|
||||
- run: cargo build
|
||||
publish:
|
||||
name: Upload
|
||||
runs-on: ubuntu-latest
|
||||
needs: build_and_test
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Get Rust toolchain
|
||||
uses: https://github.com/dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
toolchain: stable
|
||||
- run: cargo publish --release
|
||||
env:
|
||||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
Loading…
Add table
Add a link
Reference in a new issue