-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (41 loc) · 1.51 KB
/
release.yml
File metadata and controls
51 lines (41 loc) · 1.51 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
51
name: release
on:
push:
branches:
- main
paths-ignore:
- "**.md"
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
release:
name: 🚀 Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
default_bump: minor
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: ${{ steps.tag_version.outputs.new_tag }}
generateReleaseNotes: true
- name: Parse current major version
id: parse_major_version
run: |
majorVersion=$(echo ${{ steps.tag_version.outputs.new_tag }} | cut -d '.' -f 1)
echo "Current major version is $majorVersion"
echo "major_version=$majorVersion" >> $GITHUB_OUTPUT
- name: Point major version tag to the latest tag
run: |
git fetch --tags
git config --local user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git tag -f ${{ steps.parse_major_version.outputs.major_version }} ${{ steps.tag_version.outputs.new_tag }}
git push origin ${{ steps.parse_major_version.outputs.major_version }} --force