diff --git a/.github/actions/build-anchor/action.yaml b/.github/actions/build-anchor/action.yaml index 5fe6ac72..a967eaeb 100644 --- a/.github/actions/build-anchor/action.yaml +++ b/.github/actions/build-anchor/action.yaml @@ -11,7 +11,7 @@ runs: using: "composite" steps: - name: Cache Anchor build - uses: actions/cache@v2 + uses: actions/cache@v3 id: cache-anchor-build if: env.CACHE != 'true' || steps.cache-anchor-build.outputs.cache-hit != 'true' with: @@ -24,7 +24,7 @@ runs: env: PROGRAM_ID: ${{ inputs.program_id_replacement }} run: | - sed -i "" "s/declare_id!(\".*\")/declare_id!(\"${PROGRAM_ID}\")/g" ./programs/${{ inputs.program }}/src/lib.rs + sed -i "s/declare_id!(\".*\")/declare_id!(\"${PROGRAM_ID}\")/g" ./programs/${{ inputs.program }}/src/lib.rs shell: bash - name: Build with Anchor @@ -36,11 +36,11 @@ runs: with: name: ${{inputs.program}}-so path: | - ./target/deploy/${{env.PROGRAM_NAME}}.so + ./target/deploy/${{inputs.program}}.so - name: Store IDL files uses: actions/upload-artifact@v3 with: name: ${{inputs.program}}-idl path: | - ./target/idl/${{env.PROGRAM_NAME}}.json + ./target/idl/${{inputs.program}}.json diff --git a/.github/actions/deploy-anchor/action.yaml b/.github/actions/deploy-anchor/action.yaml index f5b48c23..d1584548 100644 --- a/.github/actions/deploy-anchor/action.yaml +++ b/.github/actions/deploy-anchor/action.yaml @@ -5,6 +5,9 @@ inputs: program: description: "The program to build" required: true + program_id: + description: "The program address" + required: true rpc_url: description: "The RPC url for the cluster to deploy to" required: true @@ -15,12 +18,31 @@ inputs: runs: using: "composite" steps: - - name: Deploy with Anchor + - name: Save Upgrade Authority keypair on disk run: | echo $UPGRADE_AUTHORITY_KEYPAIR > ./upgrade-authority.json && chmod 600 ./upgrade-authority.json - ~/.cargo/bin/anchor deploy --provider.cluster $RPC_URL --provider.wallet ./upgrade-authority.json --program-name ${{ inputs.program }} - rm ./upgrade-authority.json shell: bash env: - RPC_URL: ${{ inputs.rpc_url }} UPGRADE_AUTHORITY_KEYPAIR: ${{ inputs.upgrade_authority_keypair }} + + - name: Deploy .so with Anchor + run: | + ~/.cargo/bin/anchor deploy --provider.cluster $RPC_URL --provider.wallet ./upgrade-authority.json --program-name $PROGRAM_NAME + shell: bash + env: + RPC_URL: ${{ inputs.rpc_url }} + PROGRAM_NAME: ${{ inputs.program }} + + - name: Deploy IDL with Anchor + run: | + anchor idl upgrade --provider.cluster $RPC_URL --provider.wallet .keys/upgrade-authority.json --filepath target/idl/${PROGRAM_NAME}.json PROGRAM_ID + shell: bash + env: + RPC_URL: ${{ inputs.rpc_url }} + PROGRAM_NAME: ${{ inputs.program }} + PROGRAM_ID: ${{ inputs.program_id }} + + - name: Remove Upgrade Authority keypair from disk + run: | + rm ./upgrade-authority.json + shell: bash \ No newline at end of file diff --git a/.github/workflows/check-staging-deployer-balance.yaml b/.github/workflows/check-staging-deployer-balance.yaml index 70679894..5831a757 100644 --- a/.github/workflows/check-staging-deployer-balance.yaml +++ b/.github/workflows/check-staging-deployer-balance.yaml @@ -15,6 +15,9 @@ jobs: if: contains(github.event.pull_request.labels.*.name, 'deploy-staging') runs-on: ubuntu-latest steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Solana uses: ./.github/actions/setup-solana/ @@ -39,6 +42,8 @@ jobs: # Check if the balance is less than the minimum balance using floating point comparison with `bc` if (( $(echo "$BALANCE < $MIN_BALANCE" | bc -l) )); then - echo "Balance of $PUBLIC_KEY is less than $MIN_BALANCE SOL" + echo "Balance of $PUBLIC_KEY is $BALANCE, which is less than the minimum balance of $MIN_BALANCE" exit 1 fi + + echo "Balance of $PUBLIC_KEY is $BALANCE SOL" diff --git a/programs/squads_multisig_program/Cargo.toml b/programs/squads_multisig_program/Cargo.toml index 170fe2d0..ace8ace5 100644 --- a/programs/squads_multisig_program/Cargo.toml +++ b/programs/squads_multisig_program/Cargo.toml @@ -20,3 +20,4 @@ default = [] anchor-lang = { version = "=0.29.0", features = ["allow-missing-optionals"] } anchor-spl = { version="=0.29.0", features=["token"] } solana-security-txt = "1.1.1" +# \ No newline at end of file