-
Notifications
You must be signed in to change notification settings - Fork 91
/
Copy pathaction.yml
62 lines (53 loc) · 1.89 KB
/
action.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
name: "iota-private-network setup"
description: "Setup IOTA Sandbox"
inputs:
platform:
description: "Platform to download binary for (linux or macos)"
required: true
default: "linux"
logfile:
description: "Optional log file to store server log as workflow artifact"
required: false
default: ""
runs:
using: composite
steps:
- name: Set up IOTA Node
shell: bash
run: |
set -e
mkdir -p iota
cd iota
# Set platform
PLATFORM="${{ inputs.platform }}"
echo "Looking for platform: $PLATFORM"
# pinned releases from:
# url = https://api.github.com/repos/iotaledger/iota/releases/latest
# releases might be visible before all binaries are available, so refer to fixed binaries here
if [ "$PLATFORM" = "linux" ]; then
DOWNLOAD_URL="https://github.com/iotaledger/iota/releases/download/v0.9.2-rc/iota-v0.9.2-rc-linux-x86_64.tgz"
elif [ "$PLATFORM" = "macos" ]; then
DOWNLOAD_URL="https://github.com/iotaledger/iota/releases/download/v0.9.2-rc/iota-v0.9.2-rc-macos-arm64.tgz"
else
echo "not binaries for platform: $PLATFORM"
exit 1
fi
# Download and extract
echo "Downloading from: $DOWNLOAD_URL"
curl -L -o iota.tar.gz $DOWNLOAD_URL
tar -xzf iota.tar.gz
echo "$PWD" >> $GITHUB_PATH
export PATH="$PWD:$PATH"
which iota || echo "iota not found in PATH"
ls -la "$PWD"
- name: Start the Network
shell: bash
working-directory: iota
run: |
# Clear previous configuration
rm -rf ~/.iota || true
# Check log file arg
LOGFILE="${{ inputs.logfile }}"
echo "Starting server with log file: $LOGFILE"
# Start the network
iota start --with-faucet ${{ inputs.logfile && format('> {0} 2>&1', inputs.logfile) || '' }} &