-
Notifications
You must be signed in to change notification settings - Fork 26
139 lines (115 loc) · 5.41 KB
/
binary-release.yaml
File metadata and controls
139 lines (115 loc) · 5.41 KB
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
name: Release Binaries
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
packages: write
jobs:
build-and-upload:
runs-on: ${{ matrix.os}}
strategy:
matrix:
include:
# Linux x86_64
- os: ubuntu-24.04
target: x86_64-unknown-linux-musl
# Linux ARM64
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-musl
# macOS Intel
- os: macos-15-intel
target: x86_64-apple-darwin
# macOS ARM64
- os: macos-15
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.85
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
miner-apps/target
pool-apps/target
pool-apps/jd-server/target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install capnp dependencies (Ubuntu)
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt-get install -y capnproto libcapnp-dev
- name: Install capnp dependencies (macOS)
if: startsWith(matrix.os, 'macos')
run: brew install capnp
- name: Install musl tools
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y musl-tools
- name: Add musl targets
if: startsWith(matrix.os, 'ubuntu')
run: |
rustup target add x86_64-unknown-linux-musl
rustup target add aarch64-unknown-linux-musl
- name: Build (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
cargo build --release --locked --manifest-path=miner-apps/jd-client/Cargo.toml --target ${{ matrix.target }}
cargo build --release --locked --manifest-path=pool-apps/pool/Cargo.toml --target ${{ matrix.target }}
cargo build --release --locked --manifest-path=miner-apps/translator/Cargo.toml --target ${{ matrix.target }}
- name: Build (macOS)
if: startsWith(matrix.os, 'macos')
run: |
cargo build --release --locked --manifest-path=miner-apps/jd-client/Cargo.toml
cargo build --release --locked --manifest-path=pool-apps/pool/Cargo.toml
cargo build --release --locked --manifest-path=miner-apps/translator/Cargo.toml
- name: Package Miner Apps (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
mkdir -p miner-apps-release/jd-client miner-apps-release/translator
cp miner-apps/target/${{ matrix.target }}/release/jd_client_sv2 miner-apps-release/jd-client/
cp miner-apps/target/${{ matrix.target }}/release/translator_sv2 miner-apps-release/translator/
cp -r miner-apps/jd-client/config-examples/mainnet/jdc-config-bitcoin-core-ipc-local-infra-example.toml miner-apps-release/jd-client/jdc-config.toml
cp -r miner-apps/translator/config-examples/mainnet/tproxy-config-local-jdc-example.toml miner-apps-release/translator/translator-config.toml
tar -czvf miner-apps-${{ matrix.target }}.tar.gz -C miner-apps-release .
- name: Package Pool Apps (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
mkdir -p pool-apps-release/pool
cp pool-apps/target/${{ matrix.target }}/release/pool_sv2 pool-apps-release/pool/
cp -r pool-apps/pool/config-examples/mainnet/pool-config-bitcoin-core-ipc-example.toml pool-apps-release/pool/pool-config.toml
tar -czvf pool-apps-${{ matrix.target }}.tar.gz -C pool-apps-release .
- name: Package Miner Apps (macOS)
if: startsWith(matrix.os, 'macos')
run: |
mkdir -p miner-apps-release/jd-client miner-apps-release/translator
cp miner-apps/target/release/jd_client_sv2 miner-apps-release/jd-client/
cp miner-apps/target/release/translator_sv2 miner-apps-release/translator/
cp -r miner-apps/jd-client/config-examples/mainnet/jdc-config-bitcoin-core-ipc-local-infra-example.toml miner-apps-release/jd-client/jdc-config.toml
cp -r miner-apps/translator/config-examples/mainnet/tproxy-config-local-jdc-example.toml miner-apps-release/translator/translator-config.toml
tar -czvf miner-apps-${{ matrix.target }}.tar.gz -C miner-apps-release .
- name: Package Pool Apps (macOS)
if: startsWith(matrix.os, 'macos')
run: |
mkdir -p pool-apps-release/pool
cp pool-apps/target/release/pool_sv2 pool-apps-release/pool/
cp -r pool-apps/pool/config-examples/mainnet/pool-config-bitcoin-core-ipc-example.toml pool-apps-release/pool/pool-config.toml
tar -czvf pool-apps-${{ matrix.target }}.tar.gz -C pool-apps-release .
- name: Upload Miner Apps Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: miner-apps-${{ matrix.target }}.tar.gz
asset_name: miner-apps-${{ matrix.target }}.tar.gz
tag: ${{ github.ref }}
- name: Upload Pool Apps Asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pool-apps-${{ matrix.target }}.tar.gz
asset_name: pool-apps-${{ matrix.target }}.tar.gz
tag: ${{ github.ref }}