forked from xu-cheng/latex-action
-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (37 loc) · 1.16 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
---
name: Release
on:
push:
tags:
- v?[0-9]+.[0-9]+.[0-9]+
jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/cache@v3
id: cache-git-chglog
with:
path: |
~/go/bin/git-chglog
key: ${{ runner.os }}-git-chglog
- name: Install git-chglog
if: steps.cache-git-chglog.outputs.cache-hit != 'true'
run: go install "github.com/git-chglog/git-chglog/cmd/git-chglog@latest"
- name: Generate Changelog
run: |
~/go/bin/git-chglog --tag-filter-pattern '^v?[0-9]+.[0-9]+.[0-9]+' -o "CHANGELOG-$GITHUB_REF_NAME.md" --repository-url "https://github.com/$GITHUB_REPOSITORY" "$GITHUB_REF_NAME"
cat "CHANGELOG-$GITHUB_REF_NAME.md"
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
env:
GITHUB_REPOSITORY: ${{ github.repository }}
with:
body_path: CHANGELOG-${{ github.ref_name }}.md
token: ${{ github.token }}