-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (39 loc) · 1.31 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
name: Release Workflow on PR Merge
on:
pull_request:
types: [closed]
jobs:
create-release:
if: github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref == 'dev'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Check for version update in package.json
id: check_version
uses: EndBug/version-check@v2
- name: Push Git Tag
run: |
TAG="v${{ steps.check_version.outputs.version }}"
git tag $TAG
git push origin $TAG
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_level: warn
version: ${{ steps.check_version.outputs.version }}
- name: Create/update release
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.check_version.outputs.version }}
name: v${{ steps.check_version.outputs.version }}
body: ${{ steps.changelog_reader.outputs.changes }}
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}