-
Notifications
You must be signed in to change notification settings - Fork 0
Adopt the rain-deploy 0.1.7 standard #1
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 all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e0c4643
Migrate to rain-deploy 0.1.7
thedavidmeister 62d00ab
Adopt the rain-deploy 0.1.7 standard
thedavidmeister 3613f32
Filter the suites declaration from slither like rain.deploy does
thedavidmeister c21cc9e
Mirror rain.deploy's Build tests and pin the candidate's free fields
thedavidmeister 9cf4cf8
Trim comments that re-teach the rain-deploy standard
thedavidmeister 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
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,20 @@ | ||
| name: Package Release | ||
| # Deploy repo: a manual `sol-v*` tag is the sole release trigger. | ||
| # rainix-autopublish's merge-driven, next-version lifecycle is wrong for this | ||
| # shape: it bumps the release version on every merge, while the frozen deploy | ||
| # tag only advances at deploy time. | ||
| # | ||
| # The on-chain deploy is separate and manual, run BEFORE tagging; this never | ||
| # broadcasts. rainix-tag-release's chain verification is the intended gate: a | ||
| # release is declared here only once it is a deployment that already happened. | ||
| on: | ||
| push: | ||
| tags: | ||
| - sol-v* | ||
| jobs: | ||
| release: | ||
| uses: rainlanguage/rainix/.github/workflows/rainix-tag-release.yaml@main | ||
| with: | ||
| soldeer-package: rain-extrospection-deploy | ||
| snapshot-generate-cmd: forge script ./script/Build.sol --sig "cutRelease()" && forge fmt | ||
| secrets: inherit | ||
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,3 +1,3 @@ | ||
| { | ||
| "editor.rulers": [80] | ||
| } | ||
| "editor.rulers": [80] | ||
| } |
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
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 |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| // SPDX-License-Identifier: LicenseRef-DCL-1.0 | ||
| // SPDX-FileCopyrightText: Copyright (c) 2020 Rain Open Source Software Ltd | ||
| pragma solidity =0.8.25; | ||
|
|
||
| import {BuildScript} from "rain-deploy-0.1.7/src/abstract/BuildScript.sol"; | ||
| import {DeployCandidate} from "../src/abstract/RainDeploySuitesBase.sol"; | ||
| import {ExtrospectDeploySuites} from "../src/abstract/ExtrospectDeploySuites.sol"; | ||
| import {LibRainDeploySnapshot} from "rain-deploy-0.1.7/src/lib/LibRainDeploySnapshot.sol"; | ||
|
|
||
| /// One contract's generated files: the rolling snapshot, the alias lib that | ||
| /// re-exports its pins and the released-suites lib emitted from its record. | ||
| struct GeneratedContract { | ||
| /// Places the snapshot inside `src/generated/<dir>/` and names both | ||
| /// generated libs. | ||
| string contractName; | ||
| /// Prefix for the constants the alias lib exports, e.g. `EXTROSPECT`. | ||
| string constantPrefix; | ||
| /// Snapshots are written from its `sourceCreationCode` and | ||
| /// `snapshot.dependencies`; the released lib takes its suite key and | ||
| /// artifact path from its `snapshot`. | ||
| DeployCandidate candidate; | ||
| } | ||
|
|
||
| /// @title Build | ||
| /// @notice Generates the deploy pins for every contract this repo deploys. | ||
| /// `generatedContracts()` is the only list, read by every hook below. | ||
| contract Build is BuildScript, ExtrospectDeploySuites { | ||
| /// Every contract this repo generates deploy pins for. | ||
| /// @return The generated contracts. | ||
| function generatedContracts() internal pure returns (GeneratedContract[] memory) { | ||
| GeneratedContract[] memory contracts = new GeneratedContract[](1); | ||
| contracts[0] = GeneratedContract({ | ||
| contractName: "Extrospect", constantPrefix: "EXTROSPECT", candidate: extrospectCandidate() | ||
| }); | ||
| return contracts; | ||
| } | ||
|
|
||
| /// @inheritdoc BuildScript | ||
| /// @dev In declaration order — the order the aggregate emits its entries | ||
| /// in. | ||
| function snapshotContractNames() internal pure override returns (string[] memory) { | ||
| GeneratedContract[] memory contracts = generatedContracts(); | ||
| string[] memory names = new string[](contracts.length); | ||
| for (uint256 i = 0; i < contracts.length; i++) { | ||
| names[i] = contracts[i].contractName; | ||
| } | ||
| return names; | ||
| } | ||
|
|
||
| /// @inheritdoc BuildScript | ||
| /// @dev Every alias lib, every released-suites lib and the aggregate over | ||
| /// them. | ||
| function regenerateLibs() internal override { | ||
| GeneratedContract[] memory contracts = generatedContracts(); | ||
| for (uint256 i = 0; i < contracts.length; i++) { | ||
| LibRainDeploySnapshot.writeAliasLib( | ||
| vm, | ||
| LibRainDeploySnapshot.LIB_DIR, | ||
| contracts[i].contractName, | ||
| contracts[i].constantPrefix, | ||
| LibRainDeploySnapshot.CANDIDATE | ||
| ); | ||
| LibRainDeploySnapshot.writeReleasedSuitesLib( | ||
| vm, | ||
| LibRainDeploySnapshot.LIB_DIR, | ||
| recordRoot(), | ||
| contracts[i].contractName, | ||
| contracts[i].candidate.snapshot | ||
| ); | ||
| } | ||
| LibRainDeploySnapshot.writeReleasedSuitesAggregate(vm, LibRainDeploySnapshot.LIB_DIR, snapshotContractNames()); | ||
| } | ||
|
|
||
| /// @inheritdoc BuildScript | ||
| function regenerateSnapshots() internal override { | ||
| GeneratedContract[] memory contracts = generatedContracts(); | ||
| for (uint256 i = 0; i < contracts.length; i++) { | ||
| LibRainDeploySnapshot.writeSnapshot( | ||
| vm, | ||
| LibRainDeploySnapshot.CANDIDATE, | ||
| contracts[i].contractName, | ||
| contracts[i].candidate.sourceCreationCode, | ||
| contracts[i].candidate.snapshot.dependencies | ||
| ); | ||
| } | ||
| } | ||
| } |
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.