forked from dynamiccreator/aliwa
-
-
Notifications
You must be signed in to change notification settings - Fork 0
167 lines (138 loc) · 5.71 KB
/
build-featurebranch.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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: Featurebranch
on:
push:
branches-ignore:
- 'master'
- 'develop'
jobs:
# ==========================================================================
# Build Linux version
buildLinux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: npm init
run: npm init -y
- name: Install dependencies
run: yarn
- name: Electron preparation
run: |
npm i --save-dev electron
npm i -g @electron-forge/cli
electron-forge import
- name: Configure app icon
run: |
jq '(.config.forge.makers[] | select(.name == "@electron-forge/maker-deb") | .config.icon) |= "view_resources/img/aliwa_light.png" |
(.config.forge.makers[] | select(.name == "@electron-forge/maker-deb") | .config.setupIcon) |= "view_resources/img/aliwa_light.png" |
(.config.forge.makers[] | select(.name == "@electron-forge/maker-deb") | .config.options.depends) |= [ "tor" ] |
(.config.forge.makers[] | select(.name == "@electron-forge/maker-rpm") | .config.icon) |= "view_resources/img/aliwa_light.png" |
(.config.forge.makers[] | select(.name == "@electron-forge/maker-rpm") | .config.setupIcon) |= "view_resources/img/aliwa_light.png" |
(.config.forge.makers[] | select(.name == "@electron-forge/maker-rpm") | .config.options.depends) |= [ "tor" ]' package.json > package.json.tmp
rm -f package.json
mv package.json.tmp package.json
- name: Build app
run: npm run make
- name: Check results
id: find_deliveries
run: |
echo "::set-output name=aliwa_deb::$(find . -name '*.deb')"
echo "::set-output name=aliwa_rpm::$(find . -name '*.rpm')"
- name: Create sha256 checksum files
run: |
sha256sum ${{ github.workspace }}/${{ steps.find_deliveries.outputs.aliwa_deb }} | awk '{ print $1 }' > ${{ github.workspace }}/ALiWa.deb.sha256
cat ${{ github.workspace }}/ALiWa.deb.sha256
sha256sum ${{ github.workspace }}/${{ steps.find_deliveries.outputs.aliwa_rpm }} | awk '{ print $1 }' > ${{ github.workspace }}/ALiWa.rpm.sha256
cat ${{ github.workspace }}/ALiWa.rpm.sha256
# ==========================================================================
# Build MacOS version
buildMacOS:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: npm init
run: npm init -y
- name: Install dependencies
run: yarn
- name: Electron preparation
run: |
npm i --save-dev electron
npm i -g @electron-forge/cli
electron-forge import
- name: Configure app icon
run: |
jq '(.config.forge.packagerConfig | .icon) |= "view_resources/img/icon.icns"' package.json > package.json.tmp
rm -f package.json
mv package.json.tmp package.json
- name: Build app
run: |
npm install
npm run make
- name: Include Tor binaries
run: |
wget -O ${{ github.workspace }}/Tor.libraries.MacOS.zip "https://github.com/aliascash/resources/raw/master/resources/Tor.libraries.MacOS.zip"
cd out/ALiWa-darwin-x64/ALiWa.app
unzip ${{ github.workspace }}/Tor.libraries.MacOS.zip
- name: Create delivery archive
run: |
cd out/ALiWa-darwin-x64
zip --symlinks -r -X ${{ github.workspace }}/ALiWa.zip ALiWa.app
- name: Create MacOS sha256 checksum file
run: |
shasum -a 256 ${{ github.workspace }}/ALiWa.zip | awk '{ print $1 }' > ${{ github.workspace }}/ALiWa.sha256
cat ${{ github.workspace }}/ALiWa.sha256
# ==========================================================================
# Build Windows x64 version
buildWindows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: npm init
run: npm init -y
- name: Install dependencies
run: yarn
- name: Electron preparation
run: |
npm i --save-dev electron
npm i -g @electron-forge/cli
electron-forge import
- name: Install app icon
run: |
powershell jq -f jq-win-query.txt package.json > package.json.tmp
powershell Remove-Item package.json
powershell Rename-Item package.json.tmp package.json
- name: Build application
run: |
npm install
npm run make
- name: Include Tor binaries
run: |
powershell Invoke-WebRequest -Uri "https://github.com/aliascash/resources/raw/master/resources/Tor.libraries.Win64.zip" -OutFile Tor.libraries.Win64.zip
powershell Expand-Archive Tor.libraries.Win64.zip
powershell Copy-Item -Path "Tor.libraries.Win64\Tor" -Destination "out\ALiWa-win32-x64\Tor" -Recurse
- name: Create installer
run: iscc inno-setup.iss
- name: Create zip archive and sha256 checksum
run: |
powershell Rename-Item out\ALiWa-win32-x64 ALiWa
powershell Compress-Archive out\ALiWa ALiWa.zip
powershell "(Get-FileHash ALiWa.zip).Hash > ALiWa.sha256"
powershell "(Get-Content ALiWa.sha256) | Out-File ALiWa.sha256 -Encoding ascii"
type ALiWa.sha256