-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (65 loc) · 1.78 KB
/
ci.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# This workflow will build and test an Angular project
name: Vang (ViteJS & Angular)
on:
push:
branches: ['master']
tags:
- 'v*'
pull_request:
branches: ['master']
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['>=16.0.0'] # Specify the Node.js version range
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
create-release:
runs-on: ubuntu-latest
# Only run this job when a valid tag is pushed
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Check if tag exists
id: check_tag
run: |
if [ -n "$GITHUB_REF" ]; then
TAG=${GITHUB_REF#refs/tags/}
echo "TAG=${TAG}" >> $GITHUB_ENV
else
echo "TAG=" >> $GITHUB_ENV
fi
shell: bash
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Apply changelog
run: chmod +x git_changelog.sh
- name: Generate changelog
id: changelog
run: |
CHANGELOG=$(./git_changelog.sh)
echo "CHANGELOG=$CHANGELOG" >> $GITHUB_ENV
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.TAG }}
body: |
:gem: released new version ${{ env.TAG }}
Changelog:
${{ env.CHANGELOG }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}