-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add notify job for release.yml (AST-0000) #306
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
0d423a8
Enhance release workflow to extract and output CLI version
BenAlvo1 23c6675
Add output for GH_RELEASE_TAG_NAME and clean up CLI_VERSION debug echo
BenAlvo1 e655af6
Refactor release workflow to use GITHUB_OUTPUT for setting TAG_NAME a…
BenAlvo1 b7f434b
Update release workflow to set TAG_NAME and CLI_VERSION using set-output
BenAlvo1 87300af
Add error handling for unset CLI_VERSION in release workflow
BenAlvo1 f7008b1
Add script to extract CLI version from JAR and update release workflow
BenAlvo1 fbc8c25
changed from cx-mac to cx-linux
BenAlvo1 394ba5e
added script location
BenAlvo1 e4ada8b
added script location
BenAlvo1 0003ee9
added script location
BenAlvo1 0a5e3ea
added script location
BenAlvo1 e09715d
add CLI version extraction to release workflow
BenAlvo1 afbc959
add CLI version extraction to release workflow
BenAlvo1 7366ef9
Delete step into noty jib condition for debug purpose
BenAlvo1 4f576d6
Enhance CLI version extraction script to require binary name as param…
BenAlvo1 b49369f
Check release
BenAlvo1 cdeb4b6
Delete step into noty job condition for debug purpose
BenAlvo1 ebb07f0
Refactor release workflow to consolidate output steps for tag name an…
BenAlvo1 e9a6567
revert delete step into noty jib condition for debug purpose
BenAlvo1 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 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,54 @@ | ||
#!/bin/bash | ||
|
||
# Check if a parameter is provided | ||
if [ -z "$1" ]; then | ||
echo "Error: No binary name provided. Usage: $0 <binary_name>" | ||
exit 1 | ||
fi | ||
|
||
BINARY_NAME=$1 | ||
|
||
echo "Starting CLI version extraction for binary: $BINARY_NAME..." | ||
|
||
# Find the correct JAR file in Gradle cache (excluding javadoc JARs) | ||
JAR_PATH=$(find ~/.gradle -type f -name "ast-cli-java-wrapper-*.jar" ! -name "*-javadoc.jar" | head -n 1) | ||
|
||
if [ -z "$JAR_PATH" ]; then | ||
echo "Error: ast-cli-java-wrapper JAR not found in Gradle dependencies." | ||
exit 1 | ||
fi | ||
|
||
echo "Found JAR at: $JAR_PATH" | ||
|
||
# Create a temporary directory to extract the CLI | ||
TEMP_DIR=$(mktemp -d) | ||
echo "Using temporary directory: $TEMP_DIR" | ||
|
||
unzip -j "$JAR_PATH" "$BINARY_NAME" -d "$TEMP_DIR" | ||
if [ $? -ne 0 ]; then | ||
echo "Error: Failed to unzip $BINARY_NAME from the JAR." | ||
exit 1 | ||
fi | ||
|
||
if [ ! -f "$TEMP_DIR/$BINARY_NAME" ]; then | ||
echo "Error: $BINARY_NAME not found inside the JAR." | ||
ls -la "$TEMP_DIR" | ||
exit 1 | ||
fi | ||
|
||
chmod +x "$TEMP_DIR/$BINARY_NAME" | ||
|
||
# Extract the CLI version | ||
CLI_VERSION=$("$TEMP_DIR/$BINARY_NAME" version | grep -Eo '^[0-9]+\.[0-9]+\.[0-9]+') | ||
|
||
if [ -z "$CLI_VERSION" ]; then | ||
echo "Error: CLI_VERSION is not set or is empty." | ||
exit 1 | ||
fi | ||
|
||
echo "CLI version being packed is $CLI_VERSION" | ||
|
||
# Export CLI version as an environment variable | ||
echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV | ||
|
||
echo "CLI version extraction for $BINARY_NAME completed successfully." |
This file contains 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets think about moving this script to the new workflow repo and add it as an action there - extract-cli-version that will get the repo type and will know how to search for it in each kind of repo.
this is for our next steps.