forked from tari-project/tari
-
Notifications
You must be signed in to change notification settings - Fork 1
128 lines (110 loc) · 4.23 KB
/
build_ledger_wallet.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
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
---
name: Build minotari_ledger_wallet
'on':
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]*"
branches:
- "build-all-*"
- "build-ledger-*"
schedule:
- cron: "05 00 * * *"
workflow_dispatch:
env:
TS_FILENAME: "minotari_ledger_wallet"
SHARUN: "shasum --algorithm 256"
concurrency:
# https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix
group: '${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}'
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/v') || github.ref != 'refs/heads/development' || github.ref != 'refs/heads/nextnet' || github.ref != 'refs/heads/stagenet' }}
permissions: {}
jobs:
builds:
name: building ${{ matrix.ledger_target }}
continue-on-error: ${{ matrix.best_effort || false }}
strategy:
fail-fast: false
matrix:
include:
# - ledger_target: nanos
# best_effort: true
- ledger_target: nanox
best_effort: true
- ledger_target: nanosplus
- ledger_target: flex
best_effort: true
- ledger_target: stax
best_effort: true
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- name: checkout tari
uses: actions/checkout@v4
- name: Set up QEMU for Docker
uses: docker/setup-qemu-action@v3
- name: Build ledger firwmare
shell: bash
run: |
docker run --rm \
-v ".:/app" \
-w "/app/applications/minotari_ledger_wallet/wallet" \
ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder \
cargo ledger build ${{ matrix.ledger_target }}
- name: env Setup
env:
SHA_SHORT: ${GITHUB_SHA::7}
shell: bash
run: |
BINFILE="${TS_FILENAME}-${{ matrix.ledger_target }}-${{ github.ref_name }}-${{ env.SHA_SHORT }}"
echo "BINFILE=${BINFILE}" >> $GITHUB_ENV
- name: archive ledger firmware for ${{ matrix.ledger_target }}
shell: bash
run: |
# set -xo pipefail
mkdir -p "${GITHUB_WORKSPACE}/dist"
cd "${GITHUB_WORKSPACE}/dist"
echo "Copying files for ${{ env.BINFILE }} to $(pwd)"
ls -la ${{ github.workspace }}/applications/minotari_ledger_wallet/wallet/target/${{ matrix.ledger_target }}/release/
cp -vf ${GITHUB_WORKSPACE}/applications/minotari_ledger_wallet/wallet/target/${{ matrix.ledger_target }}/release/*.json .
cp -vf ${GITHUB_WORKSPACE}/applications/minotari_ledger_wallet/wallet/target/${{ matrix.ledger_target }}/release/key*.gif .
cp -vf ${GITHUB_WORKSPACE}/applications/minotari_ledger_wallet/wallet/target/${{ matrix.ledger_target }}/release/minotari_ledger_wallet.* .
echo "Compute files shasum"
${SHARUN} * >> "${{ env.BINFILE }}.sha256"
echo "Show the shasum"
cat "${{ env.BINFILE }}.sha256"
echo "Checksum verification for files is "
${SHARUN} --check "${{ env.BINFILE }}.sha256"
7z a "${{ env.BINFILE }}.zip" *
echo "Compute archive shasum"
${SHARUN} "${{ env.BINFILE }}.zip" >> "${{ env.BINFILE }}.zip.sha256"
echo "Show the shasum"
cat "${{ env.BINFILE }}.zip.sha256"
echo "Checksum verification archive is "
${SHARUN} --check "${{ env.BINFILE }}.zip.sha256"
- name: Artifact upload for ${{ matrix.ledger_target }}
uses: actions/upload-artifact@v4
with:
name: ${{ env.BINFILE }}
path: "${{ github.workspace }}/dist/${{ env.BINFILE }}.zip*"
create-release:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
needs: [ builds ]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download binaries
uses: actions/download-artifact@v4
with:
pattern: "${{ env.TS_FILENAME }}*"
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "${{ env.TS_FILENAME }}*/**/*"
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
draft: true
allowUpdates: true
updateOnlyUnreleased: true
replacesArtifacts: true