Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bun-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.2.4
22 changes: 22 additions & 0 deletions .github/workflows/build-latest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Build and commit latest"
on: push

jobs:
build-and-commit-latest:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install bun
uses: oven-sh/setup-bun@v2
with:
bun-version-file: ".bun-version"
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build
run: bun run build
- name: Commit build
uses: EndBug/[email protected]
with:
default_author: github_actions
message: 'Update dist directory with latest build'
19 changes: 0 additions & 19 deletions .github/workflows/test-action.yaml

This file was deleted.

36 changes: 26 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,40 @@
## Squads v4 program upgrades GitHub action

This action makes it possible to initialize a Solana program deployment via your CICD pipeline.
Optionally, it also allows you to update the IDL of your program as part of the same deployment transaction.

Example usage:
In order for the program data and IDL upgrades to work, you will need to set the authority of the program data buffer, and the program's IDL authority to your vault's address:

```sh
# program data buffer
solana program set-buffer-authority PROGRAM_DATA_BUFFER_ADDRESS --new-buffer-authority YOUR_VAULT_ADDRESS

# IDL buffer
anchor idl set-authority --program-id YOUR_PROGRAM_ID --new-authority YOUR_VAULT_ADDRESS
```

### Example usage:

A detailed example (with workflows) can be found in this example repository:

https://github.com/pileks/squads-idl-deploy-example

```yml
steps:
- uses: actions/checkout@v4
- name: Upgrade program
uses: Squads-Protocol/squads-v4-program-upgrade@beta
uses: pileks/squads-v4-program-upgrade@1.0.0
with:
network-url: "https://api.mainnet-beta.solana.com"
multisig-pda: "Aumm6P4VT4RcZUspSBRRkTYt2RFCWVfUhci23LrFNfZC"
multisig-vault-index: "0"
program-id: "89xd9GGQ6gd9qcxciu5TAcH1WSbwVuMTgDseh7Vge5tp"
buffer: "Hs93mJ3HC9qJz6ttpGGk12piv1bVxndv1RE86t585Duj"
spill-address: "FU2pN8qudMjtBCnU6QAavsvhZFTgXrdJ8JkLRArRuZ4n"
network-url: "https://api.mainnet-beta.solana.com" # "https://api.devnet.solana.com" for devnet, or your own endpoint
multisig-pda: "YOUR_MULTISIG_PDA"
multisig-vault-index: "0" # Usually 0, unless you are using a non-default vault
program-id: "YOUR_PROGRAM_ID"
buffer: "BUFFER_ADDRESS"
spill-address: "SPILL_ADDRESS" # Which address receives rent from closed accounts
name: "Test Upgrade"
executable-data: "ELWwLnkMhEBsMuBUjDqHuN8sdy3AxxDAHU6MhVX5tG2U"
keypair: ${{ secrets.DEPLOYER_KEYPAIR }}
executable-data: "YOUR_PROGRAM_EXECUTABLE_DATA_ADDRESS"
keypair: ${{ secrets.DEPLOYER_KEYPAIR }} # This keypair also needs to be able to propose transactions on your multisig vault
idl-buffer: "IDL_BUFFER_ADDRESS"
```

The format of the Keypair needs to be a Uint8Array or a Private key.
22 changes: 3 additions & 19 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: "Squads V4 program upgrade"
description: "Squads v4 program upgrade Github Action"
author: "Valentin Madrid"
author: "Valentin Madrid, Jure Granic-Skender"
branding:
icon: "upload"
color: "black"
Expand Down Expand Up @@ -36,21 +36,5 @@ inputs:
description: "The idl buffer"
required: false
runs:
using: "composite"
steps:
- run: npm install
shell: bash
- run: |
npm run dev
shell: bash
env:
NETWORK_URL: ${{ inputs.network-url }}
MULTISIG_PDA: ${{ inputs.multisig-pda }}
MULTISIG_VAULT_INDEX: ${{ inputs.multisig-vault-index }}
PROGRAM_ID: ${{ inputs.program-id }}
BUFFER: ${{ inputs.buffer }}
SPILL_ADDRESS: ${{ inputs.spill-address }}
NAME: ${{ inputs.name }}
EXECUTABLE_DATA: ${{ inputs.executable-data }}
KEYPAIR: ${{ inputs.keypair }}
IDL_BUFFER: ${{ inputs.idl-buffer }}
using: "node20"
main: "dist/index.js"
Loading