-
Notifications
You must be signed in to change notification settings - Fork 10
feat(sharing): Deploy DPS contract using Github action #443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 16 commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
7fe87f8
Disable temporarily
zguesmi 1c5c65e
Add action to deploy sharing contract
zguesmi 9246b87
Use a random salt
zguesmi ffca818
Update readme
zguesmi 763f876
Verify contracts
zguesmi 47dcd99
Deploy using actions
zguesmi 0c430d0
Clean
zguesmi 237aa32
Fix CI
zguesmi 0839d20
Install foundry
zguesmi 5f41095
Provide poco and dataset registry addresses to deployment script
zguesmi 51a69cc
chore: save deployment artifacts for arbitrumSepolia (testnets, 15050…
github-actions[bot] efb8932
Fix CI
zguesmi c92d3ab
Fix CI
zguesmi 05da051
chore: save deployment artifacts for arbitrumSepolia (testnets, 15051…
github-actions[bot] e88a8cb
Deploy on Arbitrum with random salt
zguesmi aec63e3
Uncomment workflow and redeploy
zguesmi 35b77ba
Fix reusable action
zguesmi 31fce84
Debug
zguesmi b483668
chore: save deployment artifacts for arbitrumSepolia (testnets, 15069…
github-actions[bot] df8aba7
Debug
zguesmi b72632f
Rename api key env variable
zguesmi 1af9e02
Remove draft deployment
zguesmi e3c8950
Uncomment ci steps
zguesmi 479974d
Clean
zguesmi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| name: Sharing Smart Contract - Deployment | ||
|
|
||
| on: | ||
| workflow_dispatch: # Manual trigger | ||
| inputs: | ||
| network: | ||
| description: 'Network' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - hardhat | ||
| - avalancheFujiTestnet | ||
| - arbitrumSepolia | ||
| - bellecour | ||
| default: 'hardhat' | ||
| environment: | ||
| description: 'Environment' | ||
| required: true | ||
| type: choice | ||
| options: | ||
| - testnets | ||
| - mainnets | ||
| default: 'testnets' | ||
|
|
||
| jobs: | ||
|
|
||
| # Validate deployment network and environment. | ||
| validate: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| # On Github, the environment `mainnets` is restricted to | ||
| # the main branch. Here we check that it's only used with | ||
| # mainnet networks. | ||
| - name: Validate mainnet deployment | ||
| run: | | ||
| if [[ "${{ inputs.environment }}" == "mainnets" && "${{ inputs.network }}" != "bellecour" ]]; then | ||
| echo "::error::mainnets environment can only be used with mainnet networks." | ||
| exit 1 | ||
| fi | ||
| echo "Deploying to network '${{ inputs.network }}' with environment '${{ inputs.environment }}'." | ||
|
|
||
| # Build and test before deploying. | ||
| ci: | ||
| needs: validate | ||
| uses: ./.github/workflows/sharing-smart-contracts-reusable.yml | ||
| with: | ||
| node-version: 18 | ||
|
|
||
| # Run deployment steps. | ||
| deploy: | ||
| needs: ci | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write # Required for saving deployment | ||
| environment: ${{ inputs.environment }} | ||
| steps: | ||
| - name: Set environment variables | ||
| id: set-env | ||
| run: | | ||
| echo "PRIVATE_KEY=${{ secrets.PRIVATE_KEY }}" >> $GITHUB_ENV | ||
|
|
||
| if [ "${{ inputs.network }}" == "arbitrumSepolia" ]; then | ||
| echo "POCO_ADDRESS=0x14B465079537655E1662F012e99EBa3863c8B9E0" >> $GITHUB_ENV | ||
| echo "DATASET_REGISTRY_ADDRESS=0x3441A0C9FE488c51fcABa2bAAA048720f4D4F72D" >> $GITHUB_ENV | ||
| echo "ARBISCAN_API_KEY=${{ secrets.ARBISCAN_API_KEY }}" >> $GITHUB_ENV | ||
| fi | ||
|
|
||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 18 | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: packages/sharing-smart-contract | ||
| run: npm ci | ||
|
|
||
| - name: Install Foundry | ||
| uses: foundry-rs/foundry-toolchain@v1 | ||
| with: | ||
| version: stable | ||
| cache: true | ||
|
|
||
| - name: Deploy contracts | ||
| working-directory: packages/sharing-smart-contract | ||
| run: npm run deploy -- --network ${{ inputs.network }} | ||
|
|
||
| - name: Save deployment artifacts | ||
| if: inputs.network != 'hardhat' | ||
| uses: stefanzweifel/git-auto-commit-action@v5 | ||
| with: | ||
| commit_message: 'chore: save deployment artifacts for ${{ inputs.network }} (${{ inputs.environment }}, ${{ github.run_id }})' | ||
| file_pattern: 'packages/sharing-smart-contract/ignition/deployments/* packages/sharing-smart-contract/.openzeppelin/*' | ||
| commit_user_name: 'GitHub Actions Bot' | ||
| commit_user_email: 'github-actions[bot]@users.noreply.github.com' | ||
| commit_author: 'GitHub Actions Bot <github-actions[bot]@users.noreply.github.com>' | ||
|
|
||
| # TODO | ||
| - name: Verify contracts | ||
| working-directory: packages/sharing-smart-contract | ||
| run: echo "Verify contracts" # npm run verify:ignition -- <deploymentId> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,3 +15,5 @@ RPC_URL= | |
|
|
||
| ## Mnemonic for the network | ||
| MNEMONIC= | ||
|
|
||
| ARBISCAN_API_KEY= | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| # Hardhat files | ||
| cache | ||
| artifacts | ||
| !ignition/deployments/**/artifacts | ||
|
|
||
| # TypeChain files | ||
| typechain | ||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.