-
Notifications
You must be signed in to change notification settings - Fork 305
fix(pyth-lazer-puiblisher-sdk): Add Deployment Script #2587
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
26 commits
Select commit
Hold shift + click to select a range
f7cdadf
output publisher update types
darunrs 138cb3e
run publish script to test imports
darunrs 210ce40
update publish script
darunrs 62e1e7c
Update export paths
darunrs 27cc261
Return files to normal
darunrs 6026557
fix rm build command
darunrs c4ce236
add publish command
darunrs 53c9cd2
update publish ci
darunrs d724c8b
bump publisher sdk version
darunrs b793145
remove build from cargo.toml and use python for updating lib
darunrs 3c774f4
fix rust test suite
darunrs d83060c
add build sbf
darunrs 405e9ff
pin 94 for proc macro and update toolchain
darunrs 20de340
try v94 again for proc macro 2
darunrs 01eaf29
update workflow again
darunrs 5ac288e
try using later toolchain for anchor install
darunrs ca2327c
update solana version
darunrs 6d14604
try 95
darunrs b8ce394
revert some changes to workflow and pin v95 there too
darunrs 8b55ae9
try no idl
darunrs 2ec7b7b
use 82 on anchor and try suggestion
darunrs c88b413
undo changes to solana test workflow
darunrs 961af80
add impl for timestampus
darunrs 066127c
undo change to proc macro version
darunrs 96de30d
remove build sbf step
darunrs a1f2547
address pr comment
darunrs 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 |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ jobs: | |
| - name: install extra tools | ||
| run: | | ||
| cargo install --locked [email protected] | ||
| sudo apt-get install -y protobuf-compiler | ||
| sudo apt-get update && sudo apt-get install -y protobuf-compiler | ||
| - name: Install Solana Cli | ||
| run: | | ||
| sh -c "$(curl -sSfL https://release.anza.xyz/stable/install)" | ||
|
|
||
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,38 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| PACKAGE_DIR="." | ||
|
|
||
| echo "building package to generate type files" | ||
| OUT_DIR=$(cargo build --message-format=json | jq -r 'select(.reason == "build-script-executed") | .out_dir' | grep "pyth-lazer-publisher-sdk") | ||
|
|
||
| echo "using output directory: ${OUT_DIR}" | ||
|
|
||
| echo "copying files from protobuf output to package directory" | ||
| cp -r "${OUT_DIR}/protobuf" "${PACKAGE_DIR}/src/" | ||
|
|
||
| echo "deleting build.rs file" | ||
| rm -f "${PACKAGE_DIR}/build.rs" | ||
|
|
||
| echo "updating lib.rs to export local protobuf files" | ||
| python3 -c " | ||
| import re | ||
|
|
||
| def replace_mod_protobuf(file_path): | ||
| with open(file_path, 'r') as f: | ||
| content = f.read() | ||
|
|
||
| pattern = re.compile(r'mod\s+protobuf\s*\{.*?\}', re.DOTALL) | ||
|
|
||
| replacement = 'mod protobuf;' | ||
|
|
||
| new_content = pattern.sub(replacement, content) | ||
|
|
||
| with open(file_path, 'w') as f: | ||
| f.write(new_content) | ||
|
|
||
| replace_mod_protobuf('${PACKAGE_DIR}/src/lib.rs') | ||
| " | ||
|
|
||
| echo "publishing package" | ||
| cargo publish --token ${CARGO_REGISTRY_TOKEN} |
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
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.