58 lines (51 loc) 路 1.61 KB
/
build.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
name: Build
on:
push:
branches: [master]
release:
types: [published]
jobs:
build:
name: Build release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
# Install Linux dependencies
- name: Install Linux dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt-get -y update && sudo apt -y install bsdtar lzip rpm binutils libopenjp2-tools
# Download code from repository
- name: Checkout code
uses: actions/checkout@v2
# Setup Node.js
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '15'
# Build app
- name: Build web and desktop apps
run: npm install && npm run build
# Release desktop app
- name: Release desktop app
if: ${{ startsWith(github.ref, 'refs/tags/') }}
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for f in build/plagpatrol-*; do
echo "Uploading $f ..."
gh release upload ${GITHUB_REF##*/} "$f"
done
echo "Uploading YAML manifest ..."
gh release upload ${GITHUB_REF##*/} build/latest*.yml
# Release web app
- name: Release web app
if: ${{ success() && matrix.os == 'ubuntu-latest' }}
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: dist
CLEAN: true # Automatically remove deleted files from the deploy branch