-
-
Notifications
You must be signed in to change notification settings - Fork 118
68 lines (57 loc) · 1.61 KB
/
release.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Release Automation
on:
push:
branches: [main]
env:
CARGO_TERM_COLOR: always
defaults:
run:
shell: bash
jobs:
calculate-release-flags:
name: Calculate release flags
runs-on: ubuntu-latest
outputs:
release-detected: ${{ steps.release.outputs.release-detected }}
tag-name: ${{ steps.release.outputs.tag-name }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Operator | Cache
uses: Swatinem/rust-cache@v2
with:
key: release-operator-01
- name: Operator | Deduce
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_LABEL: release
RUST_LOG: info
run: |
# Run release operator
cargo run -p release-operator -- detect
release:
name: Release
if: ${{ needs.calculate-release-flags.outputs.release-detected == 'true' }}
needs:
- calculate-release-flags
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Operator | Cache
uses: Swatinem/rust-cache@v2
with:
key: release-operator-01
- name: Release | GitHub
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.calculate-release-flags.outputs.tag-name }}
name: ${{ needs.calculate-release-flags.outputs.tag-name }}
- name: Release | Crates.io
env:
RUST_LOG: info
run: |
# Publish to crates.io
cargo run -p release-operator -- publish \
--token ${{ secrets.CARGO_REGISTRY_TOKEN }}