-
Notifications
You must be signed in to change notification settings - Fork 0
127 lines (109 loc) · 4.46 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
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
name: Build/release
on:
push:
branches:
- release
paths:
- '!**'
- 'src/main'
- 'src/renderer'
- 'package.json'
- 'package-lock.json'
- 'release/app/package-lock.json'
- 'release/app/package-lock.json'
workflow_dispatch:
jobs:
init:
# if: ${{(github.event_name == 'workflow_dispatch') || (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))}}
runs-on: ubuntu-latest
steps:
- name: 'checkout'
uses: actions/checkout@v1
- name: 'Get Release Tag'
id: release_tag
uses: 'WyriHaximus/github-action-get-previous-tag@v1'
- name: 'create release_tag file'
run: |
echo ${{steps.release_tag.outputs.tag}} > release_tag.txt
- name: 'Upload Tag Artifact'
uses: actions/upload-artifact@v2
with:
name: 'release_tag'
path: |
./release_tag.txt
retention-days: 1
build:
needs: init
# if: ${{(github.event_name == 'workflow_dispatch') || (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))}}
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Build Sphinx Documenaton
run: |
sudo apt update -y
sudo apt-get install python3-sphinx -y
pip install sphinx_rtd_theme
sudo apt-get install -y latexmk
sudo apt-get install -y texlive-latex-recommended
sudo apt-get install -y texlive-latex-extra
cd docs
make latexpdf
cd ../
- name: 'Upload PDF Artifact'
uses: actions/upload-artifact@v2
with:
name: 'docs_build'
path: |
./docs/_build/latex/cpguiclient.pdf
retention-days: 1
- name: Install Node.js, NPM and Yarn
uses: actions/setup-node@v1
with:
node-version: 16
- name: Build Electron app
run: |
npm install --legacy-peer-deps
npm --prefix ./release/app install
npm run build
npm --prefix ./release/app install @electron-forge/[email protected] -D
npm --prefix ./release/app install @electron-forge/[email protected] -D
cd ./release/app && npx electron-forge import && cp ../../forge.config.template.js ./forge.config.js && npx electron-forge make
- name: 'Upload Ubuntu Artifacts'
uses: actions/upload-artifact@v2
# if: matrix.os == 'ubuntu-latest'
with:
name: 'ubuntu_build'
path: |
./release/app/out/**/ui-client*.*
retention-days: 1
# - name: 'Upload Macos Artifacts'
# uses: actions/upload-artifact@v2
# if: matrix.os == 'macos-latest'
# with:
# name: 'macos_build'
# path: |
# ./out/make/zip/darwin/x64/ui-client-darwin-x64*.zip
# retention-days: 1
release:
needs: build
# if: ${{(github.event_name == 'workflow_dispatch') || (github.event_name == 'push' && contains(github.ref, 'refs/tags/'))}}
runs-on: ubuntu-latest
steps:
- name: 'checkout'
uses: actions/checkout@v2
- name: 'Download Artifacts'
uses: actions/download-artifact@v2
- name: 'Write content of release_tag artifact to steps'
id: cat_to_steps
run: echo ::set-output name=release_tag::$(cat ./release_tag/release_tag.txt)
- name: Release Electron app
uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
automatic_release_tag: ${{ steps.cat_to_steps.outputs.release_tag }}
prerelease: true
files: |
./ubuntu_build/**/ui-client*.*
./docs_build/cpguiclient.pdf
# ./macos_build/ui-client*.*