-
-
Notifications
You must be signed in to change notification settings - Fork 148
64 lines (61 loc) · 1.79 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
on:
workflow_dispatch:
inputs:
version:
type: string
description: 'Version'
required: true
permissions:
contents: write
pull-requests: write
name: release
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Install Neovim
uses: rhysd/action-setup-vim@v1
id: neovim
with:
neovim: true
version: v0.10.3
- name: Update changelog
run: |
nvim -l scripts/generate_changelog.lua ${{ github.event.inputs.version }}
- name: Get release info
id: release_info
run: |
changes=$(nvim -l scripts/generate_changelog.lua ${{ github.event.inputs.version }} print)
{
echo 'output<<EOF'
echo "$changes"
echo 'EOF'
} >> $GITHUB_OUTPUT
- name: Commit changelog
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
COMMIT_MSG: |
chore(release): update changelog
run: |
git config user.name github-actions
git config user.email [email protected]
git add docs/changelog.org
git commit -m "${COMMIT_MSG}"
git push
- name: Tag new version
run: |
git tag -a ${{ github.event.inputs.version }} -m "${{ github.event.inputs.version }}"
git push --tags
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version }}
release_name: Release ${{ github.event.inputs.version }}
body: ${{ steps.release_info.outputs.output }}