forked from metaDAOproject/setup-anchor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
47 lines (46 loc) · 1.49 KB
/
action.yml
File metadata and controls
47 lines (46 loc) · 1.49 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
name: 'Setup Anchor'
description: 'Install Anchor, Solana CLI tools, and Node.js.'
branding:
icon: anchor
color: blue
inputs:
node-version:
description: 'Version of node.js to use'
required: false
default: '20.16.0' # LTS
solana-cli-version:
description: 'Version of Solana CLI to use'
required: false
default: '2.0.15'
anchor-version:
description: 'Version of Anchor to use'
required: false
default: '0.30.1' # latest
runs:
using: 'composite'
steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
- name: Cache Solana CLI tools
uses: actions/cache@v4
with:
path: |
~/.cache/solana/
~/.local/share/solana/
key: solana-cli-${{ runner.os }}-build-${{ inputs.solana-cli-version }}
- name: Install Solana CLI tools
# Use the old solana.com release if the version starts with 1, Anza otherwise
run: |
if [[ "${{ inputs.solana-cli-version }}" == 1* ]]; then
sh -c "$(curl -sSfL https://release.solana.com/v${{ inputs.solana-cli-version }}/install)"
else
sh -c "$(curl -sSfL https://release.anza.xyz/v${{ inputs.solana-cli-version }}/install)"
fi
shell: bash
- name: Update PATH
run: echo "/home/runner/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
shell: bash
- name: Install Anchor
run: npm i -g @coral-xyz/anchor-cli@${{ inputs.anchor-version }}
shell: bash