-
Notifications
You must be signed in to change notification settings - Fork 264
93 lines (86 loc) · 3.07 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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Release CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Fetch tags
uses: fnkr/[email protected]
with:
args: git fetch --tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Extract last tag name
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: API - Cache SBT ivy cache
uses: actions/cache@v2
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }}
- name: API - Cache SBT
uses: actions/cache@v2
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
- name: API - Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: API - Run tests and generate release artifact
run: cd server; sbt test it:test dist
- name: API - Rename artifact
uses: canastro/copy-file-action@master
with:
source: server/target/universal/mocky-2020*.zip
target: mocky-api-release.zip
- name: CLIENT - Use Node.js
uses: actions/[email protected]
with:
node-version: '14.x'
- name: CLIENT - Install dependencies
run: cd client; yarn --frozen-lockfile
# Disabled step because... there is not JS tests...
# - name: CLIENT - Run tests
# run: cd client; yarn test
- name: CLIENT - Build production app
run: cd client; yarn build
- name: CLIENT - Zip build folder
run: zip -r mocky-front-release.zip client/build
- name: Create Githbub Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.previoustag.outputs.tag }}
release_name: Release ${{ steps.previoustag.outputs.tag }}
draft: false
prerelease: false
- name: Upload API release artifact in Github Release
id: upload-api-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: mocky-api-release.zip
asset_name: mocky-api-${{ steps.previoustag.outputs.tag }}.zip
asset_content_type: application/zip
- name: Upload CLIENT release artifact in Github Release
id: upload-front-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: mocky-front-release.zip
asset_name: mocky-front-${{ steps.previoustag.outputs.tag }}.zip
asset_content_type: application/zip