Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Build Electrum

on:
pull_request:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
create_release:
description: 'Create a GitHub release'
required: false
type: boolean
default: false

jobs:
build-linux:
name: Build Linux AppImage
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build AppImage
run: |
cd contrib/build-linux/appimage
./build.sh

- name: Get version
id: version
run: |
VERSION=$(python3 contrib/print_electrum_version.py)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"

- name: Upload AppImage
uses: actions/upload-artifact@v4
with:
name: linux-appimage
path: dist/*.AppImage
if-no-files-found: error

build-windows:
name: Build Windows Executables
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build Windows executables
run: |
cd contrib/build-wine
./build.sh

- name: Get version
id: version
run: |
VERSION=$(python3 contrib/print_electrum_version.py)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"

- name: Upload Windows executables
uses: actions/upload-artifact@v4
with:
name: windows-executables
path: |
contrib/build-wine/dist/*-portable.exe
contrib/build-wine/dist/electrum-*.exe
if-no-files-found: error

build-macos:
name: Build macOS DMG
# need intel runner for now as build script expects x86_64
runs-on: macos-15-intel

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

# Build script expects a specific Python version
- name: Pin Python version
uses: actions/setup-python@v6
with:
python-version: '3.12.10'

- name: Install build dependencies
run: |
brew install autoconf automake libtool gettext coreutils

- name: Build macOS app
run: |
cd contrib/osx
./make_osx.sh

- name: Get version
id: version
run: |
VERSION=$(python3 contrib/print_electrum_version.py)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"

- name: Upload DMG
uses: actions/upload-artifact@v4
with:
name: macos-dmg
path: dist/*.dmg
if-no-files-found: error

4 changes: 4 additions & 0 deletions electrum/blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,10 @@ def verify_header(cls, header: dict, prev_hash: str, target: int, expected_heade
raise InvalidHeader("prev hash mismatch: %s vs %s" % (prev_hash, header.get('prev_block_hash')))
if constants.net.TESTNET:
return
# Skip strict difficulty verification for drivechain network
# Drivechain may have different difficulty adjustment rules
if constants.net.NET_NAME == 'drivechain':
return
bits = cls.target_to_bits(target)
if bits != header.get('bits'):
raise InvalidHeader("bits mismatch: %s vs %s" % (bits, header.get('bits')))
Expand Down
Loading
Loading