-
Notifications
You must be signed in to change notification settings - Fork 5
110 lines (108 loc) · 3.47 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Release
on:
#push:
# tags:
# - "v*.*.*"
workflow_dispatch:
inputs:
tag:
type: string
description: Release tag
required: true
jobs:
build-ubuntu:
name: Build the repository on Ubuntu
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Use Node.js 18
uses: actions/[email protected]
with:
cache: 'npm'
node-version: 18
- name: Update npm
run: sudo npm install -g npm
- name: Install electron
run: sudo npm install -g electron --unsafe-perm=true --allow-root
- name: Install npm packages
run: sudo npm ci
- name: Install dpkg, fakeroot and rpm
run: |
sudo apt-get update -y
sudo apt-get install -y dpkg fakeroot rpm
- name: Provide 777 execution rights to clipboard handler script
run: |
sudo chmod 777 node_modules/clipboard-event/platform/clipboard-event-handler-linux
sudo chmod 777 node_modules/clipboard-event/platform/clipboard-event-handler-mac
- name: Set NODE_ENV to 'production'
run: export NODE_ENV=production
- name: Make
run: sudo npm run make --if-present
- run: sudo tree . -I 'node_modules|japreader-linux-x64'
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: japReader-artifacts ubuntu-latest
path: out/make/
retention-days: 1
build-windows:
name: Build the repository on Windows
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/[email protected]
- name: Use Node.js 18
uses: actions/[email protected]
with:
cache: 'npm'
node-version: 18
- name: Update npm
run: npm install -g npm
- name: Install npm packages
run: npm ci
- name: Set NODE_ENV to 'production'
run: SET NODE_ENV=production
- name: Make
run: npm run make --if-present
- run: tree .
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: japReader-artifacts windows-latest
path: out/make/
retention-days: 1
release:
name: Create a new github release ${{ inputs.tag }}
permissions:
contents: write
runs-on: ubuntu-latest
needs: [build-ubuntu, build-windows]
steps:
- name: Checkout
uses: actions/[email protected]
- name: Download Linux Build Artifacts
uses: actions/[email protected]
with:
name: japReader-artifacts ubuntu-latest
path: make/
- name: Download Windows Build Artifacts
uses: actions/[email protected]
with:
name: japReader-artifacts windows-latest
path: make/
- name: Get Release body from CHANGELOG.md
run: sed -e '/^$/,$d' CHANGELOG.md > CHANGELOG-${{ inputs.tag }}.md
- run: tree .
- name: Release
uses: softprops/action-gh-release@v1
with:
body_path: CHANGELOG-${{ inputs.tag }}.md
files: |
make/deb/x64/*.deb
make/rpm/x64/*.rpm
make/zip/linux/x64/*.zip
make/zip/win32/x64/*.zip
make/squirrel.windows/x64/*.exe
Anki_japReader.apkg
tag_name: ${{ inputs.tag }}