-
Notifications
You must be signed in to change notification settings - Fork 17
65 lines (62 loc) · 1.91 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
name: Release
on:
push:
tags: "v*.*.*"
jobs:
Release:
name: Publish release note
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Show Tag
id: tag
run: echo ::set-output name=TAG::${GITHUB_REF##*/}
- name: Generate Release Changelog
uses: orhun/git-cliff-action@v1
id: git-cliff
with:
config: .github/workflows/cliff.toml
args: -v --strip all --latest
env:
OUTPUT: CHANGELOG.md
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
body_path: ${{ steps.git-cliff.outputs.changelog }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update Changelog
uses: orhun/git-cliff-action@v1
id: changelog
with:
config: .github/workflows/cliff.toml
args: -v
env:
OUTPUT: CHANGELOG.md
- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Bump Version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMMIT_MSG: |
chore(release): ${{ steps.tag.outputs.TAG }}
See: https://github.com/${{ github.repository }}/releases/tag/${{ steps.tag.outputs.TAG }}
run: |
version="${{ steps.tag.outputs.TAG }}"
version="${version//v/}"
sed -i'' "s/^version.*$/version = \"$version\"/g" Cargo.toml
cargo update --workspace
git add CHANGELOG.md Cargo.toml Cargo.lock
git config --global user.name 'release[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git commit -m "${COMMIT_MSG}"
git push origin HEAD:master