This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
99 lines (83 loc) · 2.89 KB
/
wallet_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
name: Compile CLI wallet binaries
on:
workflow_dispatch:
inputs:
dusk_blockchain_ref:
description: "GIT branch, ref, or SHA to checkout"
required: true
default: "main"
defaults:
run:
shell: bash
jobs:
build_and_publish:
name: Build rusk-wallet binaries for ${{ matrix.os }} with ${{ matrix.compiler }}.
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-latest, macos-11, windows-latest]
compiler: [cargo]
include:
- os: ubuntu-20.04
compiler: cargo
target: linux-x64
- os: ubuntu-22.04
compiler: cargo
target: linux-x64-libssl3
- os: macos-latest
compiler: cargo
target: macos-intel
- os: macos-11
compiler: cargo
target: macos-arm64
flags: --target=aarch64-apple-darwin
platform: aarch64-apple-darwin
- os: windows-latest
compiler: cargo
target: windows-x64
outputs:
SEMVER: ${{ steps.semver_output.outputs.SEMVER }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.dusk_blockchain_ref }}
- name: Install dependencies
uses: dsherret/rust-toolchain-file@v1
- name: Add arm target for Apple Silicon build
run: rustup target add aarch64-apple-darwin
if: ${{ matrix.os == 'macos-11' }}
- name: Build Wallet
shell: bash
working-directory: ./
run: ${{matrix.compiler}} b --release --verbose ${{matrix.flags}}
- name: Get semver from wallet binary
run: |
ls -la target/release
export SEMVER=$(cargo pkgid | perl -lpe 's/.*\@(.*)/$1/')
echo "SEMVER=$SEMVER" >> $GITHUB_ENV
echo "SEMVER=$SEMVER" >> $GITHUB_OUTPUT
- name: "Pack binaries"
run: |
mkdir -p ./${{env.SEMVER}}-${{matrix.target}}
echo "Fetching binary, changelog, and readme files..."
mv target/${{matrix.platform}}/release/rusk-wallet ./${{env.SEMVER}}-${{matrix.target}}/rusk-wallet
cp CHANGELOG.md ./${{env.SEMVER}}-${{matrix.target}}/
cp README.md ./${{env.SEMVER}}-${{matrix.target}}/
tar -czvf ruskwallet${{env.SEMVER}}-${{matrix.target}}.tar.gz ./${{env.SEMVER}}-${{matrix.target}}
ls -la *.gz
- name: "Upload Wallet Artifacts"
uses: actions/upload-artifact@v4
with:
name: rusk-wallet-${{env.SEMVER}}-${{matrix.target}}
path: ./*.gz
retention-days: 5
merge:
runs-on: ubuntu-latest
needs: build_and_publish
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@v4
with:
name: wallet-binaries-${{needs.build_and_publish.outputs.SEMVER}}
pattern: rusk-wallet-*