-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (76 loc) · 2.63 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
get-next-version:
uses: semantic-release-action/next-release-version/.github/workflows/next-release-version.yml@v4
commitlint:
name: CommitLint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Commitlint dependencies
run: npm install --global @commitlint/{cli,config-conventional}
- name: Check Commit Message (PR)
if: github.event_name == 'pull_request'
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
- name: Check Commit Message (Push)
if: github.event_name == 'push'
run: npx commitlint --last --verbose
build:
name: Build
runs-on: ubuntu-latest
needs:
- get-next-version
- commitlint
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
# checkout as wfcd-bot-boi
token: ${{ secrets.GH_TOKEN }}
- name: Install semantic-release-cargo
if: needs.get-next-version.outputs.new-release-published == 'true'
uses: EricCrosson/install-github-release-binary@v2
with:
targets: semantic-release-cargo/semantic-release-cargo@v2
- name: Prepare semantic-release for Rust
if: needs.get-next-version.outputs.new-release-published == 'true'
run: semantic-release-cargo prepare ${{ needs.get-next-version.outputs.new-release-version }}
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Test Worldstate with all features
run: cargo test --all-features
- name: Cargo build
run: cargo build --release
- name: Semantic Release
id: release
uses: cycjimmy/[email protected]
if: needs.get-next-version.outputs.new-release-published == 'true'
env:
# push as wfcd-bot-boi
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
with:
semantic_version: 18
extra_plugins: |
@semantic-release/git
@semantic-release/changelog
@semantic-release-cargo/semantic-release-cargo