Skip to content

Add release installation support #123

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 9 commits into from
Dec 21, 2020
Merged

Add release installation support #123

merged 9 commits into from
Dec 21, 2020

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Dec 21, 2020

  • Installation script
  • Installation instructions

Note:

  • Use of the script won't be possible until there has been a release.
  • Nightly installation support will be added in a subsequent PR.
  • The "Check documentation links" workflow failure is expected. It's caused by the repositories being private.

@per1234 per1234 requested review from rsora and ubidefeo December 21, 2020 03:35
CHECKLATESTVERSION_REGEX="[0-9][A-Za-z0-9\.-]*"
CHECKLATESTVERSION_LATEST_URL="https://github.com/${PROJECT_OWNER}/${PROJECT_NAME}/releases/latest"
if [ "$DOWNLOAD_TOOL" = "curl" ]; then
CHECKLATESTVERSION_TAG=$(curl -SsL $CHECKLATESTVERSION_LATEST_URL | grep -o "<title>Release $CHECKLATESTVERSION_REGEX · ${PROJECT_OWNER}/${PROJECT_NAME}" | grep -o "$CHECKLATESTVERSION_REGEX")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rsora do you know why this approach of scraping the GitHub release page was taken in the Arduino CLI repo instead of using the "latest" link from downloads.arduino.cc (e.g., https://downloads.arduino.cc/arduino-cli/arduino-cli_latest_Linux_64bit.tar.gz?

Copy link
Contributor

Choose a reason for hiding this comment

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

The script was borrowed from the Glide repo (https://glide.sh/), we probably used the same approach as the script (that is changed thought from the time we picked it up).

Anyway, I suggest maintaining this approach for the release, as there is no "latest" service deployed for the arduino-lint currently.

@per1234
Copy link
Contributor Author

per1234 commented Dec 21, 2020

You can see a run of the installation script test CI workflow (#124) on this script, after some modifications to work around the missing and private resources that would cause the unmodified script to fail before the release, here:
https://github.com/per1234/arduino-lint/actions/runs/434892269

Copy link
Contributor

@rsora rsora left a comment

Choose a reason for hiding this comment

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

Answered your question in the comments, LGTM

CHECKLATESTVERSION_REGEX="[0-9][A-Za-z0-9\.-]*"
CHECKLATESTVERSION_LATEST_URL="https://github.com/${PROJECT_OWNER}/${PROJECT_NAME}/releases/latest"
if [ "$DOWNLOAD_TOOL" = "curl" ]; then
CHECKLATESTVERSION_TAG=$(curl -SsL $CHECKLATESTVERSION_LATEST_URL | grep -o "<title>Release $CHECKLATESTVERSION_REGEX · ${PROJECT_OWNER}/${PROJECT_NAME}" | grep -o "$CHECKLATESTVERSION_REGEX")
Copy link
Contributor

Choose a reason for hiding this comment

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

The script was borrowed from the Glide repo (https://glide.sh/), we probably used the same approach as the script (that is changed thought from the time we picked it up).

Anyway, I suggest maintaining this approach for the release, as there is no "latest" service deployed for the arduino-lint currently.

It may be useful to check the ongoing development work on the source script. Previously, it was difficult to find that
script because it's hosted in a different repository from the one the licensing comment provides.
Using the default configuration of shfmt.
Unfortunately, `local` is Bash-specific. The script's shebang (#!/bin/sh) indicates POSIX compliance was intended, so
the use of `local` is not appropriate. I used the function name as a prefix "namespace" for the previously local
variables in the attempt to achieve somewhat of the same effect in a POSIX-compliant manner.
ShellCheck is a static analysis tool for shell scripts.
I would prefer to avoid cluttering up the root of the repository too much. The reason is that when people visit the
repository on GitHub, they must scroll down past the root directory listing before getting to the readme. Some files and
folders must be in the root, but there are some others (e.g., gon.config.hcl) that can be moved to a subfolder, so this
move can be part of a larger campaign.
arduino-lint uses the --version flag.
@per1234 per1234 force-pushed the per1234/install-script branch from cf6c9d1 to ca03ece Compare December 21, 2020 15:35
@per1234 per1234 merged commit 2573f87 into main Dec 21, 2020
@per1234 per1234 deleted the per1234/install-script branch December 21, 2020 15:43
@per1234 per1234 added topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement labels Sep 29, 2021
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: infrastructure Related to project infrastructure type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants