Skip to content
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

Fix JS github action logic #71

Merged
merged 3 commits into from
Dec 18, 2023
Merged

Fix JS github action logic #71

merged 3 commits into from
Dec 18, 2023

Conversation

jasonpaulos
Copy link
Contributor

For a while, the github action for JS generation has been failing. Example: https://github.com/algorand/js-algorand-sdk/actions/runs/7241641297/job/19725977258

The problem was the logic to invoke the generator in .github/actions/sdk-codegen/entrypoint.sh became outdated and out of sync with scripts/generate_typescript.sh, shown below:

# Clean previously (stale) generated files before regenerating them.
find $SDK_DIR/src/client/v2/algod/models/* $SDK_DIR/src/client/v2/indexer/models/* -delete
java -jar target/generator-*-jar-with-dependencies.jar \
template \
-s "$ALGOD_SPEC" \
-t "$TEMPLATE_DIR" \
-m "$SDK_DIR/src/client/v2/algod/models" \
-p "$TEMPLATE_DIR/algod_config.properties,$TEMPLATE_DIR/parameter_order_overrides.properties" \
java -jar target/generator-*-jar-with-dependencies.jar \
template \
-s "$INDEXER_SPEC" \
-t "$TEMPLATE_DIR" \
-m "$SDK_DIR/src/client/v2/indexer/models" \
-p "$TEMPLATE_DIR/indexer_config.properties" \

Additionally, I've updated the every languages' script to include the new step of cleaning directories before generation, which is currently present in their scripts/generate_x.sh files.

Perhaps there's a smarter way to deduplicate this logic, but I just wanted to fix the problem for now.

@jasonpaulos
Copy link
Contributor Author

jasonpaulos commented Dec 18, 2023

@gmalouf gmalouf merged commit 61473bf into master Dec 18, 2023
2 checks passed
@gmalouf gmalouf deleted the fix-js-github-action branch December 18, 2023 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants