-
Notifications
You must be signed in to change notification settings - Fork 0
166 lines (137 loc) · 5.32 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
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
name: Build and Package HDWallet
on:
pull_request:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, macos-15, ubuntu-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Ensure Dist Directory Exists
run: |
mkdir -p dist
echo "Dist directory ensured."
- name: Install OpenSSL (macOS)
if: matrix.os == 'macos-15' || matrix.os == 'macos-latest'
run: |
brew install openssl
$(brew --prefix openssl)/bin/openssl version
sudo mkdir -p /usr/local/include /usr/local/lib
sudo ln -sf $(brew --prefix openssl)/include/openssl /usr/local/include/openssl
sudo ln -sf $(brew --prefix openssl)/lib/libcrypto.dylib /usr/local/lib/libcrypto.dylib
sudo ln -sf $(brew --prefix openssl)/lib/libssl.dylib /usr/local/lib/libssl.dylib
echo "LDFLAGS=-L$(brew --prefix openssl)/lib" >> $GITHUB_ENV
echo "CPPFLAGS=-I$(brew --prefix openssl)/include" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig" >> $GITHUB_ENV
echo "PATH=$(brew --prefix openssl)/bin:$PATH" >> $GITHUB_ENV
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt cx_Freeze
- name: Build macOS App for Intel
if: matrix.os == 'macos-15'
run: |
echo "Starting Intel build using x86_64 architecture..."
arch -x86_64 python setup.py bdist_dmg || exit 1
echo "Checking for .dmg and .app files after Intel build:"
find . -name "*.dmg" || echo "No .dmg file found after Intel build"
find . -name "*.app" || echo "No .app file found after Intel build"
# Move .dmg files
if find build -name "*.dmg" 1> /dev/null 2>&1; then
mkdir -p dist
mv build/*.dmg dist/
elif find dist -name "*.dmg" 1> /dev/null 2>&1; then
mv dist/*.dmg dist/
else
echo "No .dmg file found for Intel build"
exit 1
fi
# Move .app files if they exist
if find build -name "*.app" 1> /dev/null 2>&1; then
mkdir -p dist
mv build/*.app dist/
elif find dist -name "*.app" 1> /dev/null 2>&1; then
mv dist/*.app dist/
else
echo "No .app file found for Intel build, skipping."
fi
echo "Intel build completed successfully. Contents of dist directory:"
ls -R dist || echo "dist directory does not exist"
- name: Build macOS App for ARM64
if: matrix.os == 'macos-latest'
run: |
echo "Starting ARM64 build using arm64 architecture..."
arch -arm64 python setup.py bdist_dmg || exit 1
echo "Checking for .dmg and .app files after ARM64 build:"
find . -name "*.dmg" || echo "No .dmg file found after ARM64 build"
find . -name "*.app" || echo "No .app file found after ARM64 build"
# Move .dmg files
if find build -name "*.dmg" 1> /dev/null 2>&1; then
mkdir -p dist
mv build/*.dmg dist/
else
echo "No .dmg file found for ARM64 build"
exit 1
fi
# Move .app files if they exist
if find build -name "*.app" 1> /dev/null 2>&1; then
mkdir -p dist
mv build/*.app dist/
else
echo "No .app file found for ARM64 build, skipping."
fi
echo "ARM64 build completed successfully. Contents of dist directory:"
ls -R dist || echo "dist directory does not exist"
- name: Build .deb Package for Ubuntu
if: startsWith(matrix.os, 'ubuntu-latest')
run: |
python build_deb.py
if ls dist/*.deb 1> /dev/null 2>&1; then
echo "Deb package created successfully"
else
echo "No .deb file found in dist directory"
fi
- name: Build Windows Executable
if: matrix.os == 'windows-latest'
run: |
python setup.py build
python setup.py bdist_msi
if (Test-Path dist/*.msi) {
Write-Output "MSI package created successfully"
} else {
Write-Output "No MSI package found in dist directory"
}
- name: Upload Ubuntu .deb Package
if: startsWith(matrix.os, 'ubuntu-latest')
uses: actions/upload-artifact@v3
with:
name: ubuntu-deb-package
path: dist/*
- name: Upload Windows Executables
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: windows-executables
path: dist/*
- name: Upload Intel Build Artifacts
if: matrix.os == 'macos-15'
uses: actions/upload-artifact@v3
with:
name: macos-intel-artifacts
path: dist/*
- name: Upload ARM64 Build Artifacts
if: matrix.os == 'macos-latest'
uses: actions/upload-artifact@v3
with:
name: macos-arm64-artifacts
path: dist/*