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

Initial action implementation #1

Merged
merged 3 commits into from
Oct 5, 2023
Merged

Initial action implementation #1

merged 3 commits into from
Oct 5, 2023

Conversation

miki725
Copy link
Contributor

@miki725 miki725 commented Oct 3, 2023

This adds basic implementation of the action to setup chalk in github actions. The script:

  • downloads chalk
  • verifies checksum
  • add $HOME/.chalk/bin to PATH
  • installs chalk to $HOME/.chalk/bin/chalk
  • wraps docker command in $HOME/.chalk/bin/docker

Action shows basic logic which shows up as:

image

However if debug logging is enabled, the script enables set -x in bash which will show all executed commands (a bit verbose but shows exactly what it does) in addition to showing all chalk output as verbose


There are 3 types of actions in github:

  • javascript/node script
  • docker entrypoint
  • composite action

Composite action was chosen as it allows to execute a basic bash script which potentially can be reused to install chalk in other CI environments/containers

@miki725 miki725 force-pushed the initial branch 30 times, most recently from 28203df to d4e49c4 Compare October 4, 2023 13:31
@miki725 miki725 force-pushed the initial branch 18 times, most recently from 5d35601 to f348446 Compare October 5, 2023 16:13
url=$URL_PREFIX/$(chalk_version_name)
info Downloading chalk from "$url"
rm -f "$TMP/$name"{,.sha256}
wget --quiet --directory-prefix=$TMP "$url"{,.sha256} || (

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% on Github's macosx runners, but wget isn't available by default in macos. curl usually is though

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# get the chalk file name for the version/os/architecture
function chalk_version_name {
echo "chalk-$version-$(uname -s)-$(uname -m)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just flagging here that that uname -s will return Darwin on macosx boxes. We have packages generated server side that will correctly resolve to 'Darwin' but just flagging as 'macos' is often used elsewhere.
NOT broken, just noting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is expected behavior. we upload Darwin variant to the release folder for this reason so the download is super simple without any conditional logic

Copy link

@MyNameIsMeerkat MyNameIsMeerkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of tiny comments, and one potential bug where wget being called that will probably fail on a macos runner

Copy link

@MyNameIsMeerkat MyNameIsMeerkat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, slack convo verified wget availability on GH macosx runners 👍

@miki725 miki725 merged commit 11e1ecb into main Oct 5, 2023
1 check passed
@miki725 miki725 deleted the initial branch October 5, 2023 19:40
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.

3 participants