-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c48512
commit da0ac0f
Showing
2 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Setup Anchor | ||
|
||
An optimized action for installing [Anchor](https://www.anchor-lang.com/). | ||
|
||
# Usage | ||
|
||
Here's an example workflow: | ||
|
||
```yaml | ||
name: example-workflow | ||
on: [push] | ||
jobs: | ||
run-anchor-build: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: metadaoproject/[email protected] | ||
- run: anchor build | ||
shell: bash | ||
``` | ||
This will use the default versions of Anchor, Node.js, and the Solana CLI tools, which are 0.27.0, 16.15.1, and 1.15.2 respectively. You can also configure these versions like so: | ||
```yaml | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: metadaoproject/[email protected] | ||
with: | ||
anchor-version: '0.24.2' | ||
solana-cli-version: '1.10.32' | ||
node-version: '16.15.1' | ||
``` | ||
# License | ||
The scripts and documentation in this project are released under the [MIT License](LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
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: '16.15.1' # LTS | ||
solana-cli-version: | ||
description: 'Version of Solana CLI to use' | ||
required: false | ||
default: '1.15.2' # stable | ||
anchor-version: | ||
description: 'Version of Anchor to use' | ||
required: false | ||
default: '0.27.0' # latest | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
- name: Cache Solana CLI tools | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.cache/solana/ | ||
~/.local/share/solana/ | ||
key: solana-cli-${{ runner.os }}-build-${{ inputs.solana-cli-version }} | ||
- name: Install Solana CLI tools | ||
run: sh -c "$(curl -sSfL https://release.solana.com/v${{ inputs.solana-cli-version }}/install)" | ||
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 @project-serum/anchor-cli@${{ inputs.anchor-version }} | ||
shell: bash | ||
|