-
-
Notifications
You must be signed in to change notification settings - Fork 0
123 lines (100 loc) · 3 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Release
on:
workflow_dispatch:
jobs:
validate:
uses: ./.github/workflows/validate.yml
release:
needs: validate
permissions:
contents: write
outputs:
tag: ${{ steps.tag.outputs.tag }}
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/[email protected]
with:
ref: ${{ github.ref_name }}
- name: Cache rust
uses: Swatinem/[email protected]
- name: Install cargo-release
run: cargo install cargo-release
- name: Cargo login
run: cargo login ${{ secrets.CRATES_API_TOKEN }}
- name: Setup git
run: |
git config user.name "github-actions[bot]"
git config user.email "[email protected]"
- name: Release rust library
run: cargo release --execute --no-confirm --tag-prefix "" --unpublished
- name: Output tag
id: tag
run: echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT
github-release:
needs: release
permissions:
contents: write
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/[email protected]
- name: Create Github release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.release.outputs.tag }}
publish-coverage:
needs: release
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
id-token: write
pages: write
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/[email protected]
- name: Cache rust
uses: Swatinem/[email protected]
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- name: Generate coverage report
run: |
cargo tarpaulin --out html -- --test-threads=1
mkdir tarpaulin
mv ./tarpaulin-report.html ./tarpaulin/index.html
- name: Upload GitHub Pages artifact
uses: actions/[email protected]
with:
path: ./tarpaulin
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]
update-branches:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Merge main -> develop
uses: devmasx/[email protected]
with:
from_branch: main
target_branch: develop
github_token: ${{ github.token }}
type: now
- uses: actions/[email protected]
with:
ref: develop
- name: Install cargo-release
run: cargo install cargo-release
- name: Setup git
run: |
git config user.name "github-actions[bot]"
git config user.email "[email protected]"
- name: Update version
run: |
cargo release version patch --execute --no-confirm
git add Cargo.toml
git commit --message "Update version: patch"
git push