-
Notifications
You must be signed in to change notification settings - Fork 37
144 lines (117 loc) · 4.68 KB
/
build.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: Build
on:
workflow_dispatch:
push:
tags:
- "*"
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install dependencies
run: |
npm install
cp third-party/sentry-cli ./sentry-cli
- name: Create environment.ts file
run: |
echo "${{ secrets.ENV_PROD }}" > src/environments/environment.prod.ts
echo "${{ secrets.ENV_PROD }}" > src/environments/environment.ts
- name: Build Angular app
run: npm run build:prod
- name: Sentry Inject Source Maps
run: sentry-cli sourcemaps inject ./dist
- name: Sentry Upload Source Maps
run: |
VERSION=$(node -p "require('./package.json').version")
sentry-cli sourcemaps upload --use-artifact-bundle --release=$VERSION --validate ./dist
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: Install Electron dependencies
run: npm install electron electron-builder --save-dev
- name: Build Electron app
run: electron-builder build --linux
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Upload Linux Artifacts
uses: actions/upload-artifact@v2
with:
name: "linux-artifacts"
path: |
release/*.AppImage
release/*.deb
release/*.yml
build-windows:
runs-on: windows-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install dependencies
run: npm install
- name: Create environment.ts file
run: |
echo "${{ secrets.ENV_PROD }}" > src/environments/environment.prod.ts
echo "${{ secrets.ENV_PROD }}" > src/environments/environment.ts
- name: Build Angular app
run: npm run build:prod
- name: Sentry Inject Source Maps
run: sentry-cli.exe sourcemaps inject ./dist
- name: Sentry Upload Source Maps
run: |
VERSION=$(node -p "require('./package.json').version")
sentry-cli.exe sourcemaps upload --use-artifact-bundle --release=$VERSION --validate ./dist
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
- name: Install Electron dependencies
run: npm install electron electron-builder --save-dev
- name: Build Electron app
run: electron-builder build --windows
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Upload Windows Artifacts
uses: actions/upload-artifact@v2
with:
name: "windows-artifacts"
path: |
release/*.exe
release/*.yml
release/*.blockmap
upload:
name: "Create release and upload artifacts"
needs:
- build-linux
- build-windows
runs-on: ubuntu-latest
steps:
- name: Download Linux Artifacts
uses: actions/download-artifact@v2
with:
name: linux-artifacts
- name: Download Windows Artifacts
uses: actions/download-artifact@v2
with:
name: windows-artifacts
- name: "Inspect directory after downloading artifacts"
run: ls -alFR
- name: Create GitHub release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GH_TOKEN }}
automatic_release_tag: "nightly-${{ github.run_number }}"
title: "Release ${{ github.ref_name }}"
files: |
linux-artifacts/*
windows-artifacts/*