-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (52 loc) · 1.85 KB
/
pr.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
name: Create Release PR
on:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
create-pr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup git user
run: |
git config user.email "[email protected]"
git config user.name "Takeru Sato"
- name: Install rust toolchain stable
uses: dtolnay/rust-toolchain@v1
with:
toolchain: stable
target: x86_64-unknown-linux-gnu
- name: Setup Node.js
uses: actions/setup-node@v4
- run: sudo npm install -g standard-version
- name: Determine tag and generate release body
run: standard-version --infile RELEASE_BODY.md --skip.commit
- name: Generate release context
id: release_context
run: |
tag="$(git describe HEAD --abbrev=0)"
echo "tag_name=$tag" >>$GITHUB_OUTPUT
echo "version=${tag/v/}" >>$GITHUB_OUTPUT
git tag -d "${tag}"
- name: Install cargo-release
uses: taiki-e/install-action@v2
with:
tool: cargo-release
- run: cargo release ${{ steps.release_context.outputs.version }} --execute --no-confirm --no-tag --no-push --no-publish
- run: git reset --soft HEAD^
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: "Release ${{ steps.release_context.outputs.tag_name }}"
body-path: RELEASE_BODY.md
branch: "release/${{ steps.release_context.outputs.tag_name }}"
commit-message: "chore(release): ${{ steps.release_context.outputs.tag_name }}"
- uses: actions/upload-artifact@v4
with:
name: "release-note-${{ steps.release_context.outputs.tag_name }}"
path: RELEASE_BODY.md
retention-days: 1