forked from Bertrand256/electrum-dash
-
Notifications
You must be signed in to change notification settings - Fork 6
223 lines (217 loc) · 8.22 KB
/
build_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
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
name: Build release workflow
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag name'
required: true
type: string
target_os:
description: 'Target OS for build'
required: true
type: choice
options:
- All
- Linux
- Windows
- macOS
- Android
prerelease:
description: "True to set 'Pre-Release' option"
required: true
type: boolean
draft:
description: "True to set 'Draft' option"
required: true
type: boolean
jobs:
create_release:
runs-on: ubuntu-22.04
name: Create github release
outputs:
upload_url: >
${{ steps.get_release.outputs.upload_url ||
steps.create_release.outputs.upload_url }}
steps:
- name: Try to Get Release
id: get_release
uses: Bertrand256/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ inputs.tag }}
- name: Create Release
id: create_release
if: ${{ !steps.get_release.outputs.upload_url }}
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ inputs.tag }}
release_name: ${{ inputs.tag }}
draft: ${{ inputs.draft }}
prerelease: ${{ inputs.prerelease }}
build_osx:
needs: create_release
runs-on: macos-13
if: ${{ inputs.target_os == 'All' || inputs.target_os == 'macOS' }}
name: create release for macOS
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set outputs for pkg_ver
id: set_vars
run: |
source ./contrib/dash/electrum_dash_version_env.sh
echo "pkg_ver=$(echo $DASH_ELECTRUM_VERSION)" >> $GITHUB_OUTPUT
- name: Prepare build
env:
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }}
run: |
./contrib/dash/actions/install-osx.sh
- name: Build dmg
env:
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }}
run: |
./contrib/dash/actions/script-osx.sh
- name: Upload Release Asset
uses: Bertrand256/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ inputs.tag }}
asset_path: dist/Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-macosx.dmg
asset_name: Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-macosx.dmg
build_apk:
needs: create_release
runs-on: ubuntu-22.04
if: ${{ inputs.target_os == 'All' || inputs.target_os == 'Android' }}
strategy:
matrix:
arch: ['armeabi-v7a', 'arm64-v8a']
is_mainnet: [['true', 'Electrum_DASH'],
['false', 'Electrum_DASH_Testnet']]
env:
APP_ANDROID_ARCH: ${{ matrix.arch }}
ELECTRUM_MAINNET: ${{ matrix.is_mainnet[0] }}
name: create release for Android
steps:
- name: Install apt packages
run: |
sudo apt-get update
sudo apt-get install gettext python3-virtualenv
- name: Checkout
uses: actions/checkout@v1
- name: Set outputs for pkg_ver, apk_ver, vercode, is_release
id: set_vars
run: |
source ./contrib/dash/electrum_dash_version_env.sh
echo "pkg_ver=$(echo $DASH_ELECTRUM_VERSION)" >> $GITHUB_OUTPUT
echo "apk_ver=$(echo $DASH_ELECTRUM_APK_VERSION)" >> $GITHUB_OUTPUT
echo "vercode=$(echo $DASH_ELECTRUM_VERSION_CODE)" >> $GITHUB_OUTPUT
echo "is_release=$(echo $IS_RELEASE)" >> $GITHUB_OUTPUT
- name: Prepare build
if: ${{ steps.set_vars.outputs.is_release || matrix.is_mainnet[0] == 'false' }}
env:
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }}
DASH_ELECTRUM_APK_VERSION: ${{ steps.set_vars.outputs.apk_ver }}
DASH_ELECTRUM_VERSION_CODE: ${{ steps.set_vars.outputs.vercode }}
IS_RELEASE: ${{ steps.set_vars.outputs.is_release }}
run: |
./contrib/dash/actions/install-linux-apk.sh
- name: Build apk
if: ${{ steps.set_vars.outputs.is_release || matrix.is_mainnet[0] == 'false' }}
env:
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }}
DASH_ELECTRUM_APK_VERSION: ${{ steps.set_vars.outputs.apk_ver }}
DASH_ELECTRUM_VERSION_CODE: ${{ steps.set_vars.outputs.vercode }}
IS_RELEASE: ${{ steps.set_vars.outputs.is_release }}
run: |
./contrib/dash/actions/script-linux-apk.sh
- name: Upload Release Asset
if: ${{ steps.set_vars.outputs.is_release || matrix.is_mainnet[0] == 'false' }}
uses: Bertrand256/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ inputs.tag }}
asset_path: dist/${{ matrix.is_mainnet[1] }}-${{ steps.set_vars.outputs.apk_ver }}-${{ matrix.arch }}-release-unsigned.apk
asset_name: ${{ matrix.is_mainnet[1] }}-${{ steps.set_vars.outputs.apk_ver }}-${{ matrix.arch }}-release-unsigned.apk
build_linux:
needs: create_release
runs-on: ubuntu-22.04
if: ${{ inputs.target_os == 'All' || inputs.target_os == 'Linux' }}
name: create release for Linux
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set outputs for pkg_ver
id: set_vars
run: |
source ./contrib/dash/electrum_dash_version_env.sh
echo "pkg_ver=$(echo $DASH_ELECTRUM_VERSION)" >> $GITHUB_OUTPUT
- name: Prepare build
env:
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }}
run: |
./contrib/dash/actions/install-linux.sh
- name: Build Linux
env:
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }}
run: |
./contrib/dash/actions/script-linux.sh
- name: Upload sdist tar.gz Release Asset
uses: Bertrand256/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ inputs.tag }}
asset_path: dist/Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}.tar.gz
asset_name: Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}.tar.gz
- name: Upload sdist zip Release Asset
uses: Bertrand256/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ inputs.tag }}
asset_path: dist/Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}.zip
asset_name: Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}.zip
- name: Upload AppImage Release Asset
uses: Bertrand256/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ inputs.tag }}
asset_path: dist/Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-x86_64.AppImage
asset_name: Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-x86_64.AppImage
build_windows:
needs: create_release
runs-on: ubuntu-22.04
if: ${{ inputs.target_os == 'All' || inputs.target_os == 'Windows' }}
name: create release for Windows
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set outputs for pkg_ver
id: set_vars
run: |
source ./contrib/dash/electrum_dash_version_env.sh
echo "pkg_ver=$(echo $DASH_ELECTRUM_VERSION)" >> $GITHUB_OUTPUT
- name: Prepare build
env:
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }}
run: |
./contrib/dash/actions/install-wine.sh
- name: Build Windows
env:
DASH_ELECTRUM_VERSION: ${{ steps.set_vars.outputs.pkg_ver }}
run: |
./contrib/dash/actions/script-wine.sh
- name: Upload Win64 Release Asset
uses: Bertrand256/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag: ${{ inputs.tag }}
asset_path: dist/Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-setup-win64.exe
asset_name: Dash-Electrum-${{ steps.set_vars.outputs.pkg_ver }}-setup-win64.exe