-
Notifications
You must be signed in to change notification settings - Fork 9
168 lines (144 loc) · 6.01 KB
/
build-linux-arm64-installer.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: 📦🚀 Build Installer - Linux DEB ARM64
on:
push:
branches:
- 'long_lived/**'
- main
- 'release/**'
tags:
- '**'
pull_request:
branches:
- '**'
jobs:
build:
name: Linux arm64 DEB Installer
runs-on: [Linux, ARM64]
container: chianetwork/ubuntu-18.04-builder:latest
timeout-minutes: 120
strategy:
fail-fast: false
max-parallel: 4
matrix:
python-version: [3.8]
steps:
- uses: Chia-Network/actions/clean-workspace@main
- name: Add safe git directory
uses: Chia-Network/actions/git-mark-workspace-safe@main
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Cleanup any leftovers that exist from previous runs
run: bash build_scripts/clean-runner.sh || true
- name: Set Env
if: github.event_name == 'release' && github.event.action == 'published'
run: |
PRE_RELEASE=$(jq -r '.release.prerelease' "$GITHUB_EVENT_PATH")
RELEASE_TAG=$(jq -r '.release.tag_name' "$GITHUB_EVENT_PATH")
echo "RELEASE=true" >>$GITHUB_ENV
echo "PRE_RELEASE=$PRE_RELEASE" >>$GITHUB_ENV
echo "RELEASE_TAG=$RELEASE_TAG" >>$GITHUB_ENV
if [ $PRE_RELEASE = false ]; then
echo "FULL_RELEASE=true" >>$GITHUB_ENV
else
echo "FULL_RELEASE=false" >>$GITHUB_ENV
fi
# Create our own venv outside of the git directory JUST for getting the ACTUAL version so that install can't break it
- name: Get version number
id: version_number
run: |
python3 -m venv ../venv
. ../venv/bin/activate
pip3 install setuptools_scm
echo "::set-output name=LITTLELAMBOCOIN_INSTALLER_VERSION::$(python3 ./build_scripts/installer-version.py)"
deactivate
# Get the most recent release from chia-plotter-madmax
- uses: actions/github-script@v6
id: 'latest-madmax'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const release = await github.rest.repos.getLatestRelease({
owner: 'Chia-Network',
repo: 'chia-plotter-madmax',
});
return release.data.tag_name;
- name: Get latest madmax plotter
run: |
mkdir "$GITHUB_WORKSPACE/madmax"
wget -O "$GITHUB_WORKSPACE/madmax/littlelambocoin_plot" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot-${{ steps.latest-madmax.outputs.result }}-arm64
wget -O "$GITHUB_WORKSPACE/madmax/littlelambocoin_plot_k34" https://github.com/Chia-Network/chia-plotter-madmax/releases/download/${{ steps.latest-madmax.outputs.result }}/chia_plot_k34-${{ steps.latest-madmax.outputs.result }}-arm64
chmod +x "$GITHUB_WORKSPACE/madmax/littlelambocoin_plot"
chmod +x "$GITHUB_WORKSPACE/madmax/littlelambocoin_plot_k34"
# Get the most recent release from bladebit
- uses: actions/github-script@v6
if: '!github.event.release.prerelease'
id: 'latest-bladebit'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
const release = await github.rest.repos.getLatestRelease({
owner: 'Chia-Network',
repo: 'bladebit',
});
return release.data.tag_name;
- name: Get latest bladebit plotter
if: '!github.event.release.prerelease'
run: |
mkdir "$GITHUB_WORKSPACE/bladebit"
wget -O /tmp/bladebit.tar.gz https://github.com/Chia-Network/bladebit/releases/download/${{ steps.latest-bladebit.outputs.result }}/bladebit-${{ steps.latest-bladebit.outputs.result }}-ubuntu-arm64.tar.gz
tar -xvzf /tmp/bladebit.tar.gz -C $GITHUB_WORKSPACE/bladebit
chmod +x "$GITHUB_WORKSPACE/bladebit/bladebit"
- name: Get latest prerelease bladebit plotter
if: env.PRE_RELEASE == 'true'
run: |
PRERELEASE_URL=$(curl -Ls -H "Accept: application/vnd.github+json" "https://api.github.com/repos/Chia-Network/bladebit/releases" | jq -r 'map(select(.prerelease)) | first.assets[] | select(.browser_download_url | endswith("ubuntu-arm64.tar.gz")).browser_download_url')
mkdir "$GITHUB_WORKSPACE/bladebit"
wget -O /tmp/bladebit.tar.gz $PRERELEASE_URL
tar -xvzf /tmp/bladebit.tar.gz -C $GITHUB_WORKSPACE/bladebit
chmod +x "$GITHUB_WORKSPACE/bladebit/bladebit"
- uses: ./.github/actions/install
with:
python-version: ${{ matrix.python-version }}
development: true
- uses: chia-network/actions/activate-venv@main
- name: Prepare GUI cache
id: gui-ref
run: |
gui_ref=$(git submodule status littlelambocoin-blockchain-gui | sed -e 's/^ //g' -e 's/ littlelambocoin-blockchain-gui.*$//g')
echo "${gui_ref}"
echo "::set-output name=GUI_REF::${gui_ref}"
- name: Cache GUI
uses: actions/cache@v3
id: cache-gui
with:
path: ./littlelambocoin-blockchain-gui
key: ${{ runner.os }}-arm64-littlelambocoin-blockchain-gui-${{ steps.gui-ref.outputs.GUI_REF }}
- if: steps.cache-gui.outputs.cache-hit != 'true'
name: Build GUI
continue-on-error: false
run: |
cd ./build_scripts
bash build_linux_deb-1-gui.sh
- name: Build arm64 .deb package
env:
LITTLELAMBOCOIN_INSTALLER_VERSION: ${{ steps.version_number.outputs.LITTLELAMBOCOIN_INSTALLER_VERSION }}
run: |
ldd --version
cd ./build_scripts
sh build_linux_deb-2-installer.sh arm64
- name: Upload Linux artifacts
uses: actions/upload-artifact@v3
with:
name: littlelambocoin-installers-linux-deb-arm64
path: ${{ github.workspace }}/build_scripts/final_installer/
- name: Clean up on self hosted runner
run: |
sudo rm -rf build_scripts/final_installer
- name: Remove working files to exclude from cache
run: |
rm -rf ./littlelambocoin-blockchain-gui/packages/gui/daemon