-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (84 loc) · 2.34 KB
/
Copy pathrelease.yml
File metadata and controls
91 lines (84 loc) · 2.34 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
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: Rust Release
on:
push:
tags:
- "v**"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: write
jobs:
release:
outputs:
tag: ${{ github.ref_name }}
name: ${{ github.ref_name }}
prerelease: ${{ steps.regex-tag.outputs.match == '' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: KyoriPowered/action-regex-match@v4
id: regex-tag
with:
text: ${{ github.ref }}
regex: '^refs\/tags\/v\d+\.\d+\.\d+$'
cargo-semver:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: stable
- uses: cargo-prebuilt/cargo-prebuilt-action@v4
with:
pkgs: cargo-semver-checks
- name: Semver Checks
run: cargo +${{steps.toolchain.outputs.name}} semver-checks
publish-crates-io:
if: ${{ ! contains(github.ref, '-dev') }}
runs-on: ubuntu-latest
environment: release
needs:
- release
- cargo-semver
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: stable
- name: Publish
run: cargo +${{steps.toolchain.outputs.name}} publish --verbose --token "${CRATES_TOKEN}"
env:
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
publish-github-com:
runs-on: ubuntu-latest
needs:
- release
- cargo-semver
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: stable
- name: Build Release
run: cargo +${{steps.toolchain.outputs.name}} build --verbose --workspace --release
- name: Create and push artifacts to release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.release.outputs.tag }}
name: ${{ needs.release.outputs.name }}
allowUpdates: true
prerelease: ${{ needs.release.outputs.prerelease }}
body: ""