Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbogle committed Nov 22, 2022
1 parent ef51fc8 commit fb345c4
Showing 1 changed file with 7 additions and 27 deletions.
34 changes: 7 additions & 27 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,53 +29,35 @@ outputs:
runs:
using: "composite"
steps:
- uses: actions/cache@v2
name: Cache Builds
id: cache-buffer
with:
path: |
./target
./buffer.out
./idl-buffer.out
key: ${{ inputs.network }}-${{ inputs.program-id }}-anchor-verified-build-${{ hashFiles('programs/**/*.rs') }}-${{ hashFiles('./**/Cargo.lock') }}
- run: ~/.cargo/bin/anchor build --verifiable -p $PROGRAM
- run: anchor build --verifiable -p $PROGRAM
shell: bash
# if: steps.cache-buffer.outputs.cache-hit != 'true'
env:
PROGRAM: ${{ inputs.program }}
- run: solana-keygen new -o keyp --no-bip39-passphrase
shell: bash
- run: echo KEYPAIR
- run: solana-keygen new -o buffer-keypair --no-bip39-passphrase
shell: bash
env:
KEYPAIR: ${{ inputs.keypair }}
- run: echo "$KEYPAIR" > ./deploy-keypair.json && chmod 600 ./deploy-keypair.json
shell: bash
env:
KEYPAIR: ${{ inputs.keypair }}
- run: cat deploy-keypair.json
shell: bash
- name: Buffer Deploy
# if: steps.cache-buffer.outputs.cache-hit != 'true'
id: buffer-deploy
uses: nick-invision/retry@v2
with:
timeout_minutes: 30
max_attempts: 10
shell: bash
command: solana program write-buffer --buffer ./keyp -k ./deploy-keypair.json ./target/verifiable/$PROGRAM.so -u $NETWORK > ./buffer.out
command: solana program write-buffer --buffer ./buffer-keypair -k ./deploy-keypair.json ./target/verifiable/$PROGRAM.so -u $NETWORK > ./buffer.out
env:
NETWORK: ${{ inputs.network }}
PROGRAM: ${{ inputs.program }}
- name: IDL Buffer Deploy
uses: nick-invision/retry@v2
id: idl-buffer-deploy
# if: steps.cache-buffer.outputs.cache-hit != 'true'
with:
timeout_minutes: 10
max_attempts: 50
max_attempts: 10
shell: bash
command: ~/.cargo/bin/anchor idl write-buffer $PROGRAM_ID --filepath ./target/idl/$PROGRAM.json --provider.cluster $NETWORK --provider.wallet ./deploy-keypair.json > idl-buffer.out
command: anchor idl write-buffer $PROGRAM_ID --filepath ./target/idl/$PROGRAM.json --provider.cluster $NETWORK --provider.wallet ./deploy-keypair.json > idl-buffer.out
env:
PROGRAM_ID: ${{ inputs.program-id }}
PROGRAM: ${{ inputs.program }}
Expand All @@ -92,10 +74,9 @@ runs:
shell: bash
- name: Transfer idl buffer to authority
uses: nick-invision/retry@v2
# if: steps.cache-buffer.outputs.cache-hit != 'true'
with:
timeout_minutes: 10
max_attempts: 50
max_attempts: 10
shell: bash
command: anchor idl set-authority $IDL_BUFFER --provider.cluster $NETWORK --program-id $PROGRAM_ID --new-authority $AUTHORITY --provider.wallet ./deploy-keypair.json
env:
Expand All @@ -105,10 +86,9 @@ runs:
PROGRAM_ID: ${{ inputs.program-id }}
- name: Transfer buffer to authority
uses: nick-invision/retry@v2
# if: steps.cache-buffer.outputs.cache-hit != 'true'
with:
timeout_minutes: 10
max_attempts: 50
max_attempts: 10
shell: bash
command: solana program set-buffer-authority $BUFFER -k ./deploy-keypair.json --new-buffer-authority $AUTHORITY -u $NETWORK
env:
Expand Down

0 comments on commit fb345c4

Please sign in to comment.