-
Notifications
You must be signed in to change notification settings - Fork 81
54 lines (49 loc) · 2.01 KB
/
create-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
name: Create tag
on:
workflow_dispatch:
env:
GIT_CHGLOG_VERSION: "0.15.4"
SVU_VERSION: "1.12.0"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Fetches entire history, so we can analyze commits since last tag
fetch-depth: 0
persist-credentials: true
fetch-tags: true
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- uses: Bpazy/setup-git-chglog@v1
with:
git-chglog-version: ${{ env.GIT_CHGLOG_VERSION}}
- uses: obfu5c8/action-svu@v1
id: install_svu
with:
type: none
svu-version: ${{ env.SVU_VERSION}}
- name: get version
id: get_version
run: |
current_version="$(svu current --tag-mode current-branch --strip-prefix)"
prerelease_version="$(svu prerelease --tag-mode all-branches --strip-prefix --pre-release prerelease)"
release_version="$(svu next --tag-mode all-branches --strip-prefix)"
echo "CURRENT_VERSION=${current_version}" >> $GITHUB_OUTPUT
echo "PRERELEASE_VERSION=${prerelease_version}" >> $GITHUB_OUTPUT
echo "RELEASE_VERSION=${release_version}" >> $GITHUB_OUTPUT
echo "current version: ${current_version}"
echo "prerelease version: ${prerelease_version}"
echo "release version: ${release_version}"
- name: generate change log for release
run: |
git-chglog --next-tag "v${{ steps.get_version.outputs.RELEASE_VERSION }}" > CHANGELOG.md
- name: Add updated changelog
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: "chore(release): v${{ steps.get_version.outputs.RELEASE_VERSION }}"
add: "CHANGELOG.md"
tag: "v${{ steps.get_version.outputs.RELEASE_VERSION }}"
tag_push: '--force'