Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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: 0 additions & 1 deletion .github/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
CARGO_TERM_COLOR=always
NODE_VERSION=20.x
PROGRAMS=["mpl-core"]
RUST_VERSION=1.79.0
SOLANA_VERSION=1.18.19
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/benchmark-summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
with:
ref: ${{ inputs.git_ref }}

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/build-programs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
with:
ref: ${{ inputs.git_ref }}

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down Expand Up @@ -70,7 +73,7 @@ jobs:
fi
SANITIZED=${REF//\//-}
echo "sanitized=$SANITIZED" >> "$GITHUB_OUTPUT"

- name: Upload program builds
uses: actions/upload-artifact@v4
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/build-rust-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
with:
ref: ${{ inputs.git_ref }}

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down
40 changes: 21 additions & 19 deletions .github/workflows/deploy-program.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ env:

jobs:
check_tag:
name: 'Check tag'
name: "Check tag"
runs-on: ubuntu-latest
outputs:
program: ${{ steps.set_program.outputs.program }}
type: ${{ steps.set_program.outputs.type }}
steps:
- name: Check tag
id: set_program
run: |
echo program="core" >> $GITHUB_OUTPUT
if [[ "${{ inputs.git_ref }}" =~ ^release/core@* ]]; then
echo type="release" >> $GITHUB_OUTPUT
else
echo type="ref" >> $GITHUB_OUTPUT
fi
- name: Check tag
id: set_program
run: |
echo program="core" >> $GITHUB_OUTPUT
if [[ "${{ inputs.git_ref }}" =~ ^release/core@* ]]; then
echo type="release" >> $GITHUB_OUTPUT
else
echo type="ref" >> $GITHUB_OUTPUT
fi
build_programs:
name: Programs
uses: ./.github/workflows/build-programs.yml
Expand Down Expand Up @@ -109,6 +109,9 @@ jobs:
token: ${{ secrets.SVC_TOKEN }}
ref: ${{ inputs.git_ref }}

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down Expand Up @@ -152,7 +155,7 @@ jobs:
run: |
echo PROGRAM_NAME="mpl_core" >> $GITHUB_ENV
echo ${{ secrets.CORE_ID }} > ./program-id.json

if [[ "${{ inputs.cluster }}" == "sonic"* ]]; then
echo ${{ secrets.CORE_SONIC_DEPLOY_KEY }} > ./deployer-key.json
echo DEPLOY_TYPE="direct" >> $GITHUB_ENV
Expand All @@ -172,7 +175,7 @@ jobs:
else
echo "Invalid cluster: ${{ inputs.cluster }}"
exit 1
fi
fi

- name: Sanitize Ref
id: sanitize
Expand All @@ -190,7 +193,7 @@ jobs:
if: needs.check_tag.outputs.type == 'ref'
with:
name: program-builds-${{ steps.sanitize.outputs.sanitized }}

- name: Download release asset
uses: actions/github-script@v5
id: get_release
Expand All @@ -206,11 +209,11 @@ jobs:
repo: context.repo.repo,
tag: tag
});

if (release.status !== 200) {
throw new Error(`Failed to fetch release for tag ${tag}`);
}

const asset = release.data.assets.find(asset => asset.name === assetName);
if (!asset) {
throw new Error(`Asset ${assetName} not found in release tagged ${tag}`);
Expand Down Expand Up @@ -259,20 +262,19 @@ jobs:
rm ./submitter-key.json

echo "BUFFER=$BUFFER" >> $GITHUB_ENV


- name: Create Squads proposal
if: github.event.inputs.dry_run == 'false' && env.DEPLOY_TYPE == 'squads'
uses: metaplex-foundation/squads-program-upgrade@main
with:
network-url: ${{ env.RPC }}
program-multisig: ${{ env.SQUADS_MULTISIG }}
program-id: 'CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d'
program-id: "CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d"
program-index: ${{ env.SQUADS_PROGRAM_INDEX }}
buffer: ${{ env.BUFFER }}
spill-address: 'botTxAkJhuCtNNn9xsH8fHJjzTkcN6XD4dR3R5hkzV2'
spill-address: "botTxAkJhuCtNNn9xsH8fHJjzTkcN6XD4dR3R5hkzV2"
authority: ${{ env.SQUADS_VAULT }}
Comment on lines +275 to 279
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Parameterize static values; consider centralizing addresses.

Using env.SQUADS_MULTISIG, env.BUFFER, and a hardcoded spill-address is fine, but extracting the static spill address into a repo variable or secret could simplify updates if it ever changes.

🤖 Prompt for AI Agents
In .github/workflows/deploy-program.yml around lines 275 to 279, the hardcoded
spill-address value should be parameterized by moving it to a centralized
repository variable or secret. Replace the static spill-address string with a
reference to this new environment variable to make future updates easier and
maintain consistency across the codebase.

name: 'Deploy ${{ inputs.git_ref }}'
name: "Deploy ${{ inputs.git_ref }}"
keypair: ${{ secrets.SQUADS_BOT_KEY }}

- name: Create env tag
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

- name: Detect changes
uses: dorny/paths-filter@v2
id: changes
Expand Down Expand Up @@ -65,6 +62,9 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

Comment on lines +74 to +76
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Missing Rust/Solana version exports in Generate clients job
The generate_clients job only echoes NODE_VERSION but later installs Rust and Solana using env.RUST_VERSION and env.SOLANA_VERSION. Add those exports here:

-      - name: Export GitHub vars to GITHUB_ENV
-        run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV
+      - name: Export GitHub vars to GITHUB_ENV
+        run: |
+          echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV
+          echo "RUST_VERSION=${{ vars.RUST_VERSION }}" >> $GITHUB_ENV
+          echo "SOLANA_VERSION=${{ vars.SOLANA_VERSION }}" >> $GITHUB_ENV
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV
- name: Export GitHub vars to GITHUB_ENV
run: |
echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV
echo "RUST_VERSION=${{ vars.RUST_VERSION }}" >> $GITHUB_ENV
echo "SOLANA_VERSION=${{ vars.SOLANA_VERSION }}" >> $GITHUB_ENV
🤖 Prompt for AI Agents
In .github/workflows/main.yml around lines 74 to 76, the generate_clients job
exports only NODE_VERSION to GITHUB_ENV but uses RUST_VERSION and SOLANA_VERSION
later. Add echo commands to export RUST_VERSION and SOLANA_VERSION to GITHUB_ENV
alongside NODE_VERSION to ensure these environment variables are available
during the job execution.

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish-js-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down Expand Up @@ -117,6 +120,9 @@ jobs:
with:
ref: ${{ github.ref }}

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish-rust-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test-js-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node: ["20.x", "22.x"]
node: ["${{ vars.NEXT_VERSION }}", "${{ vars.NEXT_VERSION_NEXT }}"]
steps:
- name: Git checkout
uses: actions/checkout@v4
with:
ref: ${{ inputs.git_ref }}

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down Expand Up @@ -66,6 +69,9 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-programs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
with:
ref: ${{ inputs.git_ref }}

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test-rust-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
with:
ref: ${{ inputs.git_ref }}

- name: Export GitHub vars to GITHUB_ENV
run: echo "NODE_VERSION=${{ vars.NODE_VERSION }}" >> $GITHUB_ENV

- name: Load environment variables
run: cat .github/.env >> $GITHUB_ENV

Expand Down Expand Up @@ -59,4 +62,4 @@ jobs:
- name: Run tests
shell: bash
working-directory: configs/scripts/client
run: RUST_LOG=error ./test-rust.sh
run: RUST_LOG=error ./test-rust.sh