-
Notifications
You must be signed in to change notification settings - Fork 20
40 lines (32 loc) · 1.05 KB
/
tag-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
name: Tag and Release on Merge from Release Branch
on:
pull_request:
types: [closed]
branches:
- main
workflow_dispatch:
jobs:
release:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'chore(release)/v')
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare
uses: ./.github/actions/prepare
- name: Get version from package.json
id: get_version
run: |
version=$(node -p "require('./package.json').version")
echo "Version from package.json: $version"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Create Git tag
run: |
git tag "v${{ steps.get_version.outputs.version }}"
git push origin "v${{ steps.get_version.outputs.version }}"
- name: Draft Release Notes
id: draft_release
uses: release-drafter/release-drafter@v6
with:
version: "v${{ steps.get_version.outputs.version }}"
token: ${{ secrets.GIX_CREATE_PR_PAT }}