|
| 1 | +name: Build Releases |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ master ] |
| 6 | + tags: [ '*' ] |
| 7 | + pull_request: |
| 8 | + branches: [ master ] |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +jobs: |
| 12 | + build-linux: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v4 |
| 16 | + with: |
| 17 | + submodules: recursive |
| 18 | + fetch-depth: 0 |
| 19 | + |
| 20 | + - name: Fix script permissions |
| 21 | + run: | |
| 22 | + chmod +x contrib/*.sh |
| 23 | + chmod +x contrib/build-linux/appimage/*.sh |
| 24 | +
|
| 25 | + - name: Build Docker image for AppImage |
| 26 | + run: | |
| 27 | + docker build -t electrum-appimage-builder contrib/build-linux/appimage/ |
| 28 | +
|
| 29 | + - name: Build AppImage |
| 30 | + run: | |
| 31 | + docker run --rm --user $(id -u):$(id -g) -v "$PWD:/electrum" electrum-appimage-builder bash -c "cd /electrum && chmod +x contrib/*.sh contrib/build-linux/appimage/*.sh && cd contrib/build-linux/appimage && bash build.sh" |
| 32 | +
|
| 33 | + - name: Rename AppImage |
| 34 | + run: | |
| 35 | + cd dist |
| 36 | + for f in electrum-*.AppImage; do |
| 37 | + mv "$f" "lbry-vault-${f#electrum-}" |
| 38 | + done |
| 39 | +
|
| 40 | + - name: Upload Linux artifacts |
| 41 | + uses: actions/upload-artifact@v4 |
| 42 | + with: |
| 43 | + name: linux-appimage |
| 44 | + path: dist/*.AppImage |
| 45 | + |
| 46 | + build-windows: |
| 47 | + runs-on: ubuntu-latest |
| 48 | + steps: |
| 49 | + - uses: actions/checkout@v4 |
| 50 | + with: |
| 51 | + submodules: recursive |
| 52 | + fetch-depth: 0 |
| 53 | + |
| 54 | + - name: Fix script permissions |
| 55 | + run: | |
| 56 | + chmod +x contrib/*.sh |
| 57 | + chmod +x contrib/build-wine/*.sh |
| 58 | +
|
| 59 | + - name: Build Docker image for Wine |
| 60 | + run: | |
| 61 | + docker build -t electrum-wine-builder contrib/build-wine/ |
| 62 | +
|
| 63 | + - name: Build Windows executables |
| 64 | + run: | |
| 65 | + docker run --rm -v "$PWD:/opt/wine64/drive_c/electrum" -w /opt/wine64/drive_c/electrum/contrib/build-wine electrum-wine-builder bash -c "git config --global --add safe.directory '*' && chmod +x *.sh ../make_libsecp256k1.sh ../build_tools_util.sh && ./build.sh" |
| 66 | +
|
| 67 | + - name: Upload Windows artifacts |
| 68 | + uses: actions/upload-artifact@v4 |
| 69 | + with: |
| 70 | + name: windows-executables |
| 71 | + path: | |
| 72 | + contrib/build-wine/dist/*.exe |
| 73 | + !contrib/build-wine/dist/electrum/*.exe |
| 74 | +
|
| 75 | + build-macos: |
| 76 | + runs-on: macos-14 |
| 77 | + steps: |
| 78 | + - uses: actions/checkout@v4 |
| 79 | + with: |
| 80 | + submodules: recursive |
| 81 | + fetch-depth: 0 |
| 82 | + |
| 83 | + - name: Fix script permissions |
| 84 | + run: | |
| 85 | + chmod +x contrib/*.sh |
| 86 | + chmod +x contrib/osx/* |
| 87 | +
|
| 88 | + - name: Install system dependencies |
| 89 | + run: | |
| 90 | + brew install automake autoconf libtool gettext coreutils |
| 91 | +
|
| 92 | + - name: Set up Python |
| 93 | + uses: actions/setup-python@v5 |
| 94 | + with: |
| 95 | + python-version: '3.9' |
| 96 | + |
| 97 | + - name: Install Python dependencies |
| 98 | + run: | |
| 99 | + python3 -m pip install --upgrade pip setuptools wheel |
| 100 | + python3 -m pip install --no-dependencies -r contrib/deterministic-build/requirements-binaries.txt || true |
| 101 | + python3 -m pip install pyinstaller==5.13.2 |
| 102 | +
|
| 103 | + - name: Build libsecp256k1 |
| 104 | + run: | |
| 105 | + contrib/make_libsecp256k1.sh |
| 106 | + # Copy to contrib/osx for PyInstaller |
| 107 | + cp electrum/libsecp256k1.0.dylib contrib/osx/ || cp electrum/libsecp256k1.so.0 contrib/osx/libsecp256k1.0.dylib || true |
| 108 | +
|
| 109 | + - name: Download libusb |
| 110 | + run: | |
| 111 | + mkdir -p /tmp/electrum-build |
| 112 | + curl -L https://github.com/libusb/libusb/releases/download/v1.0.26/libusb-1.0.26.tar.bz2 | tar xj -C /tmp/electrum-build |
| 113 | + cd /tmp/electrum-build/libusb-1.0.26 |
| 114 | + ./configure --prefix=/tmp/libusb-install |
| 115 | + make -j4 |
| 116 | + make install |
| 117 | + cp /tmp/libusb-install/lib/libusb-1.0.dylib $GITHUB_WORKSPACE/contrib/osx/ || true |
| 118 | + cp /tmp/libusb-install/lib/libusb-1.0.0.dylib $GITHUB_WORKSPACE/contrib/osx/libusb-1.0.dylib || true |
| 119 | + ls -la $GITHUB_WORKSPACE/contrib/osx/ |
| 120 | +
|
| 121 | + - name: Generate locale |
| 122 | + run: | |
| 123 | + cd contrib/deterministic-build/electrum-locale |
| 124 | + for i in ./locale/*; do |
| 125 | + dir="$GITHUB_WORKSPACE/electrum/$i/LC_MESSAGES" |
| 126 | + mkdir -p "$dir" |
| 127 | + msgfmt --output-file="$dir/electrum.mo" "$i/electrum.po" || true |
| 128 | + done |
| 129 | +
|
| 130 | + - name: Install application dependencies |
| 131 | + run: | |
| 132 | + python3 -m pip install --no-dependencies -r contrib/deterministic-build/requirements.txt || true |
| 133 | + python3 -m pip install --no-dependencies -r contrib/deterministic-build/requirements-hw.txt || true |
| 134 | + python3 -m pip install --no-dependencies . || true |
| 135 | +
|
| 136 | + - name: Build CalinsQRReader |
| 137 | + run: | |
| 138 | + cd contrib/osx/CalinsQRReader |
| 139 | + xcodebuild -project CalinsQRReader.xcodeproj -target CalinsQRReader -configuration Release build || echo "CalinsQRReader build failed - QR scanning may not work" |
| 140 | + ls -la build/Release/ || true |
| 141 | +
|
| 142 | + - name: Build macOS app |
| 143 | + run: | |
| 144 | + VERSION=$(git describe --tags --dirty --always) |
| 145 | + export ELECTRUM_VERSION="$VERSION" |
| 146 | + pyinstaller --noconfirm --ascii --clean contrib/osx/osx.spec || echo "PyInstaller build failed - macOS build may need manual adjustment" |
| 147 | + # Rename the output to include version |
| 148 | + if [ -d "dist/Electrum.app" ]; then |
| 149 | + mv "dist/Electrum.app" "dist/${VERSION}.app" |
| 150 | + fi |
| 151 | +
|
| 152 | + - name: Create DMG |
| 153 | + run: | |
| 154 | + VERSION=$(git describe --tags --dirty --always) |
| 155 | + if [ -d "dist/Electrum.app" ] || [ -d "dist/${VERSION}.app" ]; then |
| 156 | + mv dist/Electrum.app dist/LBRY-Vault.app 2>/dev/null || true |
| 157 | + mv "dist/${VERSION}.app" dist/LBRY-Vault.app 2>/dev/null || true |
| 158 | + hdiutil create -fs HFS+ -volname "LBRY-Vault" -srcfolder dist/LBRY-Vault.app "dist/lbry-vault-${VERSION}.dmg" |
| 159 | + else |
| 160 | + echo "No app bundle found - skipping DMG creation" |
| 161 | + fi |
| 162 | +
|
| 163 | + - name: Upload macOS artifacts |
| 164 | + uses: actions/upload-artifact@v4 |
| 165 | + if: always() |
| 166 | + with: |
| 167 | + name: macos-dmg |
| 168 | + path: dist/*.dmg |
| 169 | + if-no-files-found: ignore |
| 170 | + |
| 171 | + release: |
| 172 | + needs: [build-linux, build-windows, build-macos] |
| 173 | + runs-on: ubuntu-latest |
| 174 | + if: startsWith(github.ref, 'refs/tags/') |
| 175 | + permissions: |
| 176 | + contents: write |
| 177 | + steps: |
| 178 | + - name: Download all artifacts |
| 179 | + uses: actions/download-artifact@v4 |
| 180 | + with: |
| 181 | + path: artifacts |
| 182 | + |
| 183 | + - name: List artifacts |
| 184 | + run: find artifacts -type f |
| 185 | + |
| 186 | + - name: Create Release |
| 187 | + uses: softprops/action-gh-release@v1 |
| 188 | + with: |
| 189 | + files: | |
| 190 | + artifacts/linux-appimage/* |
| 191 | + artifacts/windows-executables/* |
| 192 | + artifacts/macos-dmg/* |
| 193 | + draft: false |
| 194 | + generate_release_notes: true |
0 commit comments