Skip to content

Commit c530078

Browse files
committed
resolve merge conflicts and integrate codex improvements
1 parent 474a980 commit c530078

24 files changed

Lines changed: 1403 additions & 2038 deletions

.github/CODEOWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<<<<<<< ours
2+
* @x-pact
3+
=======
4+
* @EslamKotb
5+
>>>>>>> theirs

.github/pull_request_template.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Summary
2+
<<<<<<< ours
3+
- What changed
4+
- Why it changed
5+
6+
## Verification
7+
- [ ] Added/updated checks
8+
- [ ] Included commands and output summary
9+
10+
## Risks
11+
- Breaking changes
12+
- Operational concerns
13+
=======
14+
-
15+
16+
## Validation
17+
- [ ] `anchor build`
18+
- [ ] `anchor test`
19+
- [ ] `./scripts/verify.sh`
20+
21+
## Checklist
22+
- [ ] Docs are updated to match behavior.
23+
- [ ] Devnet Program ID references are consistent.
24+
- [ ] No placeholder, mock, or TODO content was introduced.
25+
>>>>>>> theirs

.github/workflows/build.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<<<<<<< ours
2+
name: Build
3+
4+
on:
5+
push:
6+
branches: [ main, master, work ]
7+
=======
8+
name: build
9+
10+
on:
11+
push:
12+
branches: ["**"]
13+
>>>>>>> theirs
14+
pull_request:
15+
16+
jobs:
17+
anchor-build:
18+
runs-on: ubuntu-latest
19+
<<<<<<< ours
20+
=======
21+
env:
22+
ANCHOR_VERSION: 0.32.1
23+
SOLANA_VERSION: 2.1.11
24+
NODE_VERSION: 20.18.0
25+
>>>>>>> theirs
26+
steps:
27+
- uses: actions/checkout@v4
28+
- uses: actions/setup-node@v4
29+
with:
30+
<<<<<<< ours
31+
node-version: '20.11.1'
32+
cache: yarn
33+
- name: Install Rust
34+
uses: dtolnay/rust-toolchain@stable
35+
- name: Install Solana CLI
36+
run: |
37+
sh -c "$(curl -sSfL https://release.anza.xyz/v1.18.18/install)"
38+
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
39+
solana --version
40+
- name: Install Anchor CLI (AVM)
41+
run: |
42+
cargo install --git https://github.com/coral-xyz/anchor avm --locked
43+
avm install 0.32.1
44+
avm use 0.32.1
45+
anchor --version
46+
- name: Install dependencies
47+
=======
48+
node-version: ${{ env.NODE_VERSION }}
49+
cache: yarn
50+
- name: Install Solana CLI
51+
run: |
52+
sh -c "$(curl -sSfL https://release.anza.xyz/v${SOLANA_VERSION}/install)"
53+
echo "$HOME/.local/share/solana/install/active_release/bin" >> "$GITHUB_PATH"
54+
solana --version
55+
- name: Install Anchor CLI
56+
run: |
57+
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
58+
avm install ${ANCHOR_VERSION}
59+
avm use ${ANCHOR_VERSION}
60+
echo "$HOME/.avm/bin" >> "$GITHUB_PATH"
61+
anchor --version
62+
- name: Install JS deps
63+
>>>>>>> theirs
64+
run: yarn install --frozen-lockfile
65+
- name: Anchor build
66+
run: anchor build
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Devnet Deploy
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
paths:
8+
- 'programs/**'
9+
- 'Anchor.toml'
10+
- '.github/workflows/devnet-deploy.yml'
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
env:
19+
SOLANA_RPC_URL: https://api.devnet.solana.com
20+
ANCHOR_VERSION: 0.32.1
21+
SOLANA_VERSION: 1.18.18
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: '20.11.1'
27+
cache: yarn
28+
- uses: dtolnay/rust-toolchain@stable
29+
30+
- name: Install Solana CLI
31+
run: |
32+
sh -c "$(curl -sSfL https://release.anza.xyz/v${SOLANA_VERSION}/install)"
33+
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
34+
solana --version
35+
36+
- name: Install Anchor CLI (AVM)
37+
run: |
38+
cargo install --git https://github.com/coral-xyz/anchor avm --locked
39+
avm install ${ANCHOR_VERSION}
40+
avm use ${ANCHOR_VERSION}
41+
anchor --version
42+
43+
- name: Restore deploy keypair from secret
44+
shell: bash
45+
run: |
46+
if [ -z "${{ secrets.DEVNET_DEPLOYER_KEYPAIR_B64 }}" ]; then
47+
echo "Missing secret DEVNET_DEPLOYER_KEYPAIR_B64" >&2
48+
exit 1
49+
fi
50+
mkdir -p ~/.config/solana
51+
echo "${{ secrets.DEVNET_DEPLOYER_KEYPAIR_B64 }}" | base64 -d > ~/.config/solana/devnet-deployer.json
52+
chmod 600 ~/.config/solana/devnet-deployer.json
53+
solana config set --url "$SOLANA_RPC_URL" --keypair ~/.config/solana/devnet-deployer.json
54+
solana address
55+
56+
- name: Fund deployer wallet
57+
run: |
58+
solana airdrop 2 || true
59+
solana balance
60+
61+
- name: Install dependencies
62+
run: yarn install --frozen-lockfile
63+
64+
- name: Build and deploy program
65+
env:
66+
ANCHOR_WALLET: /home/runner/.config/solana/devnet-deployer.json
67+
ANCHOR_PROVIDER_URL: https://api.devnet.solana.com
68+
run: |
69+
anchor build
70+
DEPLOY_OUT=$(anchor deploy --provider.cluster devnet)
71+
echo "$DEPLOY_OUT"
72+
PROGRAM_ID=$(echo "$DEPLOY_OUT" | sed -n 's/^Program Id: //p' | tail -n1)
73+
if [ -z "$PROGRAM_ID" ]; then
74+
echo "Unable to parse Program ID from deploy output" >&2
75+
exit 1
76+
fi
77+
echo "PROGRAM_ID=$PROGRAM_ID" >> $GITHUB_ENV
78+
79+
- name: Update docs/config.json with Program ID
80+
run: |
81+
node -e 'const fs=require("fs");const p="docs/config.json";const c=JSON.parse(fs.readFileSync(p,"utf8"));c.programId=process.env.PROGRAM_ID;c.cluster="devnet";if(!c.rpcUrl)c.rpcUrl="https://api.devnet.solana.com";fs.writeFileSync(p,JSON.stringify(c,null,2)+"\n");'
82+
cat docs/config.json
83+
84+
- name: Commit Program ID update
85+
run: |
86+
if git diff --quiet docs/config.json; then
87+
echo "No config changes to commit"
88+
exit 0
89+
fi
90+
git config user.name "github-actions[bot]"
91+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
92+
git add docs/config.json
93+
git commit -m "chore: update devnet program id in docs config"
94+
git push
95+
96+
- name: Output Program ID
97+
run: |
98+
echo "Deployed Program ID: $PROGRAM_ID"
99+
echo "Explorer: https://explorer.solana.com/address/$PROGRAM_ID?cluster=devnet"

.github/workflows/pages.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy Pages
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- 'docs/**'
8+
- 'privatedao-frontend.html'
9+
- '.github/workflows/pages.yml'
10+
11+
permissions:
12+
pages: write
13+
id-token: write
14+
15+
jobs:
16+
deploy-pages:
17+
runs-on: ubuntu-latest
18+
environment:
19+
name: github-pages
20+
url: ${{ steps.deployment.outputs.page_url }}
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/configure-pages@v5
24+
- uses: actions/upload-pages-artifact@v3
25+
with:
26+
path: docs
27+
- id: deployment
28+
uses: actions/deploy-pages@v4

.github/workflows/test.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<<<<<<< ours
2+
name: Test
3+
4+
on:
5+
push:
6+
branches: [ main, master, work ]
7+
=======
8+
name: test
9+
10+
on:
11+
push:
12+
branches: ["**"]
13+
>>>>>>> theirs
14+
pull_request:
15+
16+
jobs:
17+
anchor-test:
18+
runs-on: ubuntu-latest
19+
<<<<<<< ours
20+
=======
21+
env:
22+
ANCHOR_VERSION: 0.32.1
23+
SOLANA_VERSION: 2.1.11
24+
NODE_VERSION: 20.18.0
25+
RUST_BACKTRACE: 1
26+
>>>>>>> theirs
27+
steps:
28+
- uses: actions/checkout@v4
29+
- uses: actions/setup-node@v4
30+
with:
31+
<<<<<<< ours
32+
node-version: '20.11.1'
33+
cache: yarn
34+
- uses: dtolnay/rust-toolchain@stable
35+
- name: Install Solana CLI
36+
run: |
37+
sh -c "$(curl -sSfL https://release.anza.xyz/v1.18.18/install)"
38+
echo "$HOME/.local/share/solana/install/active_release/bin" >> $GITHUB_PATH
39+
- name: Install Anchor CLI (AVM)
40+
run: |
41+
cargo install --git https://github.com/coral-xyz/anchor avm --locked
42+
avm install 0.32.1
43+
avm use 0.32.1
44+
- name: Install dependencies
45+
run: yarn install --frozen-lockfile
46+
- name: Anchor test
47+
=======
48+
node-version: ${{ env.NODE_VERSION }}
49+
cache: yarn
50+
- name: Install Solana CLI
51+
run: |
52+
sh -c "$(curl -sSfL https://release.anza.xyz/v${SOLANA_VERSION}/install)"
53+
echo "$HOME/.local/share/solana/install/active_release/bin" >> "$GITHUB_PATH"
54+
- name: Install Anchor CLI
55+
run: |
56+
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
57+
avm install ${ANCHOR_VERSION}
58+
avm use ${ANCHOR_VERSION}
59+
echo "$HOME/.avm/bin" >> "$GITHUB_PATH"
60+
- name: Install JS deps
61+
run: yarn install --frozen-lockfile
62+
- name: Run Anchor tests
63+
>>>>>>> theirs
64+
run: anchor test --skip-build

.github/workflows/verify.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<<<<<<< ours
2+
name: Verify
3+
4+
on:
5+
push:
6+
branches: [ main, master, work ]
7+
pull_request:
8+
9+
jobs:
10+
verify:
11+
runs-on: ubuntu-latest
12+
=======
13+
name: verify
14+
15+
on:
16+
push:
17+
branches: ["**"]
18+
pull_request:
19+
20+
jobs:
21+
integrity:
22+
runs-on: ubuntu-latest
23+
env:
24+
ANCHOR_VERSION: 0.32.1
25+
SOLANA_VERSION: 2.1.11
26+
NODE_VERSION: 20.18.0
27+
>>>>>>> theirs
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-node@v4
31+
with:
32+
<<<<<<< ours
33+
node-version: '20.11.1'
34+
- name: Verify repository integrity
35+
run: bash scripts/verify.sh
36+
=======
37+
node-version: ${{ env.NODE_VERSION }}
38+
cache: yarn
39+
- name: Install Solana CLI
40+
run: |
41+
sh -c "$(curl -sSfL https://release.anza.xyz/v${SOLANA_VERSION}/install)"
42+
echo "$HOME/.local/share/solana/install/active_release/bin" >> "$GITHUB_PATH"
43+
- name: Install Anchor CLI
44+
run: |
45+
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force
46+
avm install ${ANCHOR_VERSION}
47+
avm use ${ANCHOR_VERSION}
48+
echo "$HOME/.avm/bin" >> "$GITHUB_PATH"
49+
- name: Verify toolchain + lint checks
50+
run: ./scripts/verify.sh
51+
>>>>>>> theirs

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20.18.0

Anchor.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ url = "https://api.apr.dev"
1616

1717
[provider]
1818
cluster = "localnet"
19-
wallet = "/home/do/.config/solana/id.json"
19+
wallet = "~/.config/solana/id.json"
2020

2121
[scripts]
2222
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"

0 commit comments

Comments
 (0)