Skip to content
Merged
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
51 changes: 42 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,34 @@ env:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
runner: ubuntu-latest
artifact_name: electrs
platform: x86_64-linux-gnu
use_cross: false
- target: aarch64-unknown-linux-gnu
runner: ubuntu-24.04-arm
artifact_name: electrs
platform: aarch64-linux-gnu
use_cross: false
- target: aarch64-apple-darwin
runner: macos-14
artifact_name: electrs
platform: aarch64-apple-darwin
use_cross: false
- target: x86_64-unknown-linux-musl
runner: ubuntu-latest
artifact_name: electrs
platform: x86_64-linux-musl
use_cross: true
- target: aarch64-unknown-linux-musl
runner: ubuntu-latest
artifact_name: electrs
platform: aarch64-linux-musl
use_cross: true
runs-on: ${{ matrix.runner }}

steps:
Expand All @@ -50,44 +64,62 @@ jobs:
target/
key: ${{ runner.os }}-${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}

- name: Build
- name: Install cross
if: matrix.use_cross
run: cargo install cross --git https://github.com/cross-rs/cross --tag v0.2.5

- name: Build (cross)
if: matrix.use_cross
run: cross build --release --locked --target ${{ matrix.target }}

- name: Build (cargo)
if: ${{ !matrix.use_cross }}
run: cargo build --release --locked

- name: Strip binary
run: strip target/release/${{ matrix.artifact_name }}
- name: Set binary path
id: binary
run: |
if [ "${{ matrix.use_cross }}" = "true" ]; then
echo "path=target/${{ matrix.target }}/release/${{ matrix.artifact_name }}" >> $GITHUB_OUTPUT
echo "dir=target/${{ matrix.target }}/release" >> $GITHUB_OUTPUT
else
echo "path=target/release/${{ matrix.artifact_name }}" >> $GITHUB_OUTPUT
echo "dir=target/release" >> $GITHUB_OUTPUT
fi

- name: Create tarball
env:
ASSET_NAME: electrs-${{ steps.version.outputs.tag }}-${{ matrix.platform }}
run: |
cd target/release
cd ${{ steps.binary.outputs.dir }}
tar czvf ${ASSET_NAME}.tar.gz ${{ matrix.artifact_name }}

- name: Compute SHA256 (Linux)
if: runner.os == 'Linux'
env:
ASSET_NAME: electrs-${{ steps.version.outputs.tag }}-${{ matrix.platform }}
run: |
cd target/release
cd ${{ steps.binary.outputs.dir }}
sha256sum ${ASSET_NAME}.tar.gz > ${ASSET_NAME}.tar.gz.sha256

- name: Compute SHA256 (macOS)
if: runner.os == 'macOS'
env:
ASSET_NAME: electrs-${{ steps.version.outputs.tag }}-${{ matrix.platform }}
run: |
cd target/release
cd ${{ steps.binary.outputs.dir }}
shasum -a 256 ${ASSET_NAME}.tar.gz > ${ASSET_NAME}.tar.gz.sha256

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: electrs-${{ steps.version.outputs.tag }}-${{ matrix.platform }}
path: |
target/release/electrs-${{ steps.version.outputs.tag }}-${{ matrix.platform }}.tar.gz
target/release/electrs-${{ steps.version.outputs.tag }}-${{ matrix.platform }}.tar.gz.sha256
${{ steps.binary.outputs.dir }}/electrs-${{ steps.version.outputs.tag }}-${{ matrix.platform }}.tar.gz
${{ steps.binary.outputs.dir }}/electrs-${{ steps.version.outputs.tag }}-${{ matrix.platform }}.tar.gz.sha256

publish-crate:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -102,6 +134,7 @@ jobs:
run: cargo publish

release:
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
permissions:
Expand All @@ -122,4 +155,4 @@ jobs:
generate_release_notes: true
files: |
artifacts/**/*.tar.gz
artifacts/**/*.sha256
artifacts/**/*.sha256
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ target
*.sublime*
*~
*.pyc
.claude/
3 changes: 2 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "esplora-tapyrus"
version = "0.5.7"
version = "0.5.8"
authors = ["Chaintope Inc.", "Roman Zeyde (original author) <me@romanzey.de>"]
description = "An efficient re-implementation of Electrum Server in Rust"
license = "MIT"
Expand Down Expand Up @@ -52,7 +52,12 @@ tokio = { version = "1", features = ["sync", "macros"] }
version = "^0.5.0"
features = ["use-serde"]

[dependencies.gmp-mpfr-sys]
version = "~1.6"
features = ["force-cross"]

[profile.release]
lto = true
panic = 'abort'
codegen-units = 1
strip = true
11 changes: 11 additions & 0 deletions Cross.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[target.x86_64-unknown-linux-musl]
image = "ghcr.io/cross-rs/x86_64-unknown-linux-musl:0.2.5"

[target.aarch64-unknown-linux-musl]
image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:0.2.5"
pre-build = [
# GMP's configure looks for tools named "aarch64-unknown-linux-musl-*"
# but cross-rs provides them as "aarch64-linux-musl-*".
# Create symlinks to bridge the naming mismatch.
"sh -c 'for tool in /usr/local/bin/aarch64-linux-musl-*; do ln -sf \"$tool\" \"/usr/local/bin/aarch64-unknown-linux-musl-$(basename $tool | sed s/aarch64-linux-musl-//)\"; done'",
]
Loading