-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.08 KB
/
ci.yml
File metadata and controls
47 lines (39 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: CI
on:
push:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
- name: Check if should release
id: check_release
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
echo "should_release=true" >> $GITHUB_OUTPUT
trigger-release:
needs: build
if: needs.build.outputs.should_release == 'true'
runs-on: ubuntu-latest
steps:
- name: Trigger release workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Release
token: ${{ secrets.RELEASE_TOKEN }}
inputs: '{"publish_to_crates_io": true, "release_notes": "Automated release after successful CI build"}'