-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (47 loc) · 1.7 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
name: Release
on:
push:
branches: main
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Bump version and push tag
uses: anothrNick/github-tag-action@1.71.0
id: version
env:
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
WITH_V: true
DEFAULT_BUMP: patch
- name: Major version tag
id: major-version
if: ${{ (steps.version.outputs.new_tag != '') }}
uses: actions/github-script@v7
with:
script: |
core.setOutput('tag', '${{ steps.version.outputs.new_tag }}'.split('.')[0])
- name: Tag major version ${{ steps.major-version.outputs.tag }}
if: ${{ (steps.version.outputs.new_tag != '') }}
run: |
git tag --force ${{ steps.major-version.outputs.tag }}
git push origin ${{ steps.major-version.outputs.tag }} --force
- name: Create/update major version release
if: ${{ (steps.version.outputs.new_tag != '') }}
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.PAT_TOKEN }}
allowUpdates: true
generateReleaseNotes: true
tag: ${{ steps.major-version.outputs.tag }}
name: ${{ steps.major-version.outputs.tag }} (${{ steps.version.outputs.new_tag }})
- name: Create release ${{ steps.version.outputs.new_tag }}
if: ${{ (steps.version.outputs.new_tag != '') }}
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.PAT_TOKEN }}
generateReleaseNotes: true
tag: ${{ steps.version.outputs.new_tag }}
name: Release ${{ steps.version.outputs.new_tag }}