-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (85 loc) · 3.58 KB
/
release.yml
File metadata and controls
95 lines (85 loc) · 3.58 KB
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
name: release
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
setting: ['home', 'clinic' ]
os: [ubuntu-latest, macOS-latest, windows-latest]
steps:
# Rewrite "git:" repo urls to use "https:" instead, since GitHub Actions blocks port 9418 (as of Jan 2022).
- name: Rewrite "git:" repo urls to use "https:" instead.
run: git config --global url."https://github.com/".insteadOf "git://github.com/"
# Set up js package
- uses: actions/checkout@v1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Set package version and name
uses: brown-ccv/gh-actions/get-package-info@main
id: package_info
# install, test, build package
- name: npm install
run: |
npm config set "//npm.pkg.github.com/:_authToken" ${{ secrets.GITHUB_TOKEN }}
npm install
- name: Load .env file
uses: xom9ikk/dotenv@v1.0.2
with:
path: ./env
mode: ${{matrix.setting}}
- name: npm build
run: npm run build
- name: npm test
run: npm test
env:
CI: true
# Build electron app package installers
- name: package electron - windows
if: startsWith(matrix.os, 'windows')
run: npm run package:windows
- name: package electron - linux
if: startsWith(matrix.os, 'ubuntu')
run: npm run package:linux
- name: package electron - mac
if: startsWith(matrix.os, 'mac')
run: npm run package:mac
# Upload installers to github release
- name: Upload app to release - windows
if: startsWith(matrix.os, 'windows')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: out/make/squirrel.windows/x64/${{ steps.package_info.outputs.package_name }}-${{ steps.package_info.outputs.package_version }} Setup.exe
asset_name: ${{ steps.package_info.outputs.package_name }}-${{ steps.package_info.outputs.package_version }}-${{ matrix.setting }}-setup.exe
tag: ${{ github.ref }}
- name: Upload app to release - linux
if: startsWith(matrix.os, 'ubuntu')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: out/make/deb/x64/${{ steps.package_info.outputs.package_name }}_${{ steps.package_info.outputs.package_version }}_amd64.deb
asset_name: ${{ steps.package_info.outputs.package_name }}_${{ steps.package_info.outputs.package_version }}_${{ matrix.setting }}_amd64.deb
tag: ${{ github.ref }}
- name: Upload app to release - mac
if: startsWith(matrix.os, 'mac')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: out/make/${{ steps.package_info.outputs.package_name }}-${{ steps.package_info.outputs.package_version }}-x64.dmg
asset_name: ${{ steps.package_info.outputs.package_name }}-${{ steps.package_info.outputs.package_version }}-${{ matrix.setting }}.dmg
tag: ${{ github.ref }}
# Update github pages - linux only
# if your deployment fails try https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-first-deployment-with-github_token
- name: Deploy to GH Pages
if: startsWith(matrix.os, 'ubuntu')
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build