generated from metaplex-foundation/solana-project-template
-
Notifications
You must be signed in to change notification settings - Fork 48
79 lines (71 loc) · 2 KB
/
build-programs.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
name: Build Programs
on:
workflow_call:
inputs:
rust:
type: string
solana:
type: string
git_ref:
type: string
workflow_dispatch:
inputs:
rust:
description: Rust version
default: 1.75.0
required: true
type: string
solana:
description: Solana version
default: 1.18.15
required: true
type: string
env:
CACHE: true
jobs:
build_programs:
name: Build
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.git_ref }}
- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV
- name: Install Rust
uses: metaplex-foundation/actions/install-rust@v1
with:
toolchain: ${{ inputs.rust || env.RUST_VERSION }}
- name: Install Solana
uses: metaplex-foundation/actions/install-solana@v1
with:
version: ${{ inputs.solana || env.SOLANA_VERSION }}
cache: ${{ env.CACHE }}
- name: Cache program dependencies
if: env.CACHE == 'true'
uses: metaplex-foundation/actions/cache-programs@v1
- name: Build programs
shell: bash
working-directory: configs/scripts/program
run: ./build.sh
env:
PROGRAMS: ${{ env.PROGRAMS }}
- name: Sanitize Ref
id: sanitize
shell: bash
run: |
REF="${{ inputs.git_ref }}"
if [ -z "$REF" ]; then
REF="default"
fi
SANITIZED=${REF//\//-}
echo "sanitized=$SANITIZED" >> "$GITHUB_OUTPUT"
- name: Upload program builds
uses: actions/upload-artifact@v4
with:
name: program-builds-${{ steps.sanitize.outputs.sanitized }}
# First wildcard ensures exported paths are consistently under the programs folder.
path: ./program*/.bin/*.so
include-hidden-files: true
if-no-files-found: error