-
Notifications
You must be signed in to change notification settings - Fork 84
72 lines (68 loc) · 2.19 KB
/
verify-build.yaml
File metadata and controls
72 lines (68 loc) · 2.19 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
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
name: Verify Build
permissions:
contents: read
env:
HUSKY: 0
on:
workflow_dispatch:
inputs:
program_name:
description: 'Program name'
required: true
type: string
program_id:
description: 'Program ID'
required: true
type: string
anchor-version:
description: 'Anchor version'
required: true
default: '0.29.0'
solana-cli-version:
description: 'Solana CLI version'
required: true
default: '1.17.16'
features:
description: 'Build features'
required: true
type: choice
options:
- none
- production
- devnet
default: 'production'
jobs:
verify-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: metadaoproject/setup-anchor@7d1e9699eb18c33ba5f32f6a9952f0e90515996a # v3.2
with:
anchor-version: ${{ inputs.anchor-version }}
solana-cli-version: ${{ inputs.solana-cli-version }}
- name: Cache Cargo registry + index
uses: actions/cache@v4
id: cache-cargo-registry
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: cargo-${{ runner.os }}-v0001-${{ hashFiles('**/Cargo.lock') }}
- name: Cache Solana Verify
uses: actions/cache@v4
id: cache-solana-verify
with:
path: |
~/.cargo/bin/solana-verify
key: cargo-${{ runner.os }}-solana-verify
- run: cargo install solana-verify
if: steps.cache-solana-verify.outputs.cache-hit != 'true'
shell: bash
- name: Verify build
run: |
if [ "${{ inputs.features }}" = "none" ]; then
solana-verify verify-from-repo --remote -um --program-id ${{ inputs.program_id }} https://github.com/${{ github.repository }} --library-name ${{ inputs.program_name }}
else
solana-verify verify-from-repo --remote -um --program-id ${{ inputs.program_id }} https://github.com/${{ github.repository }} --library-name ${{ inputs.program_name }} -- --features ${{ inputs.features }}
fi