-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (46 loc) · 1.36 KB
/
node.js.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
49
50
51
52
53
54
55
name: Build and Release
on:
push:
branches:
- main
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get the latest commit message
id: get_latest_commit
run: |
latest_commit=$(git log -1 --pretty=format:%s)
echo "latest_commit_message=$latest_commit" >> $GITHUB_ENV
- name: Read changelog
id: read_changelog
run: |
changelog=$(< CHANGELOG.md)
echo "CHANGELOG<<EOF" >> $GITHUB_ENV
echo "$changelog" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Set up Node.js
if: startsWith(env.latest_commit_message, 'v')
uses: actions/setup-node@v3
with:
node-version: '22'
- name: Install dependencies
if: startsWith(env.latest_commit_message, 'v')
run: npm i
- name: npm run build
if: startsWith(env.latest_commit_message, 'v')
run: npm run build
- name: Release
if: startsWith(env.latest_commit_message, 'v')
uses: softprops/action-gh-release@v1
with:
tag_name: v1.21.50
name: Release ${{ env.latest_commit_message }}
body: ${{ env.CHANGELOG }}
draft: false
prerelease: false
files: build/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}