-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (58 loc) · 1.79 KB
/
release.workflow.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
name: Make release
on:
push:
# this should trigger the workflow
# ONLY when a tag is pushed, not branch
branches:
- "!*"
tags:
- "v*"
concurrency:
cancel-in-progress: true
group: release-${{ github.ref }}
jobs:
make_release:
environment:
name: production
url: https://tinywars.onrender.com
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 16.x
cache: npm
- run: npm ci --audit=false
- run: npm run lint
- run: npm run typecheck:all
- run: npm run test:all
- run: npm run build -w frontend
- run: npm run build -w backend
- name: Create changelog
run: |
previousTag=$(git tag | tail -n 2 | head -n 1)
currentTag=$(git tag | tail -n 1)
echo "Last version is $previousTag"
echo "New version is $currentTag"
git log $previousTag..$currentTag --oneline --no-decorate --format="* %s" | tail -n+2 > CHANGELOG.md
cat CHANGELOG.md
- name: Create release bundle
run: |
currentTag=$(git tag | tail -n 1)
mkdir -p release/backend
mkdir -p release/frontend
cp -r workspaces/frontend/dist/* release/frontend/
cp -r workspaces/backend/dist/* release/backend/
cp RELEASE.md release/RELEASE.md
zip -r release_$currentTag.zip release/*
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "*.zip"
bodyFile: "CHANGELOG.md"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Trigger deploy on render.com
run: |
echo $(curl -X GET ${{ secrets.RENDER_COM_DEPLOY_HOOK }})