Commit 933b52bf authored by Nawasan Wisitsingkhon's avatar Nawasan Wisitsingkhon

workflows: refactor and create CD for deploy

parent 6c690d88
name: CD
on:
push:
branches: ["main"]
workflow_run:
workflows: ["CI"]
types:
- completed
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build
run: cargo build --release
- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish
name: CI name: CI
on: on: [push, pull_request]
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs: jobs:
linux: linux:
...@@ -54,19 +50,3 @@ jobs: ...@@ -54,19 +50,3 @@ jobs:
run: cargo build --release run: cargo build --release
- name: Run tests - name: Run tests
run: cargo test --all-features run: cargo test --all-features
release:
runs-on: ubuntu-latest
needs: [linux, windows]
steps:
- uses: actions/checkout@v4
- name: Setup
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Build
run: cargo build --release
- name: Publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment