-
Notifications
You must be signed in to change notification settings - Fork 4
50 lines (44 loc) · 1.4 KB
/
release.yml
File metadata and controls
50 lines (44 loc) · 1.4 KB
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
name: Create Release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get previous tag
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
continue-on-error: true
with:
fallback: v0.0.0
- name: Calculate new version
id: version
uses: "paulhatch/semantic-version@v5.3.0"
with:
tag_prefix: "v"
major_pattern: "BREAKING CHANGE:"
minor_pattern: "feat:"
version_format: "${major}.${minor}.${patch}"
bump_each_commit: true
- name: Delete Previous Release
if: ${{ steps.version.outputs.version != steps.previoustag.outputs.tag }}
uses: dev-drprasad/delete-tag-and-release@v1.0
with:
tag_name: ${{ steps.previoustag.outputs.tag }}
github_token: ${{ secrets.GITHUB_TOKEN }}
delete_release: true
- name: Create Release
if: ${{ steps.version.outputs.version != steps.previoustag.outputs.tag }}
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.version.outputs.version }}
name: v${{ steps.version.outputs.version }}
generate_release_notes: true
draft: false