From 07298a3b83c79c9b68f677989a2c663ca4bd5ea6 Mon Sep 17 00:00:00 2001 From: ehsash Date: Tue, 28 Jan 2025 15:23:50 +0100 Subject: [PATCH 1/2] Minor adaptations after the setup --- .github/workflows/build.yml | 8 +++++++- .tool-versions | 1 + LICENSE | 4 +--- README.md | 4 +--- bin/download | 2 +- contributing.md | 3 --- lib/utils.bash | 15 +++++---------- 7 files changed, 16 insertions(+), 21 deletions(-) mode change 100644 => 100755 lib/utils.bash diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efe740f..91a129d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: Build on: push: branches: - - main + - main pull_request: jobs: @@ -16,6 +16,12 @@ jobs: - macos-latest runs-on: ${{ matrix.os }} steps: + - name: Setup Java + uses: actions/setup-java@v3 + with: + distribution: 'temurin' + java-version: '21' + - name: asdf_plugin_test uses: asdf-vm/actions/plugin-test@v2 with: diff --git a/.tool-versions b/.tool-versions index 3d11f88..2bbb4e8 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,2 +1,3 @@ shellcheck 0.9.0 shfmt 3.6.0 +java openjdk-21-jre \ No newline at end of file diff --git a/LICENSE b/LICENSE index 678969f..c1e6f17 100644 --- a/LICENSE +++ b/LICENSE @@ -1,8 +1,6 @@ -TODO: INSERT YOUR NAME COPYRIGHT YEAR (if applicable to your license) - MIT License -Copyright (c) [year] [fullname] +Copyright (c) 2025 Ehsash Tehel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index f82105f..bbf44ab 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,8 @@ # Dependencies -**TODO: adapt this section** - - `bash`, `curl`, `tar`, and [POSIX utilities](https://pubs.opengroup.org/onlinepubs/9699919799/idx/utilities.html). -- `SOME_ENV_VAR`: set this environment variable in your shell config to load the correct version of tool x. +- `java`: requires Java Runtime Environment (JRE), installed system-wide, or via asdf # Install diff --git a/bin/download b/bin/download index c11ee53..3038906 100755 --- a/bin/download +++ b/bin/download @@ -10,7 +10,7 @@ source "${plugin_dir}/lib/utils.bash" mkdir -p "$ASDF_DOWNLOAD_PATH" -# TODO: Adapt this to proper extension and adapt extracting strategy. +# Set the release file name release_file="$ASDF_DOWNLOAD_PATH/$TOOL_NAME-$ASDF_INSTALL_VERSION.tar.gz" # Download tar.gz file to the download directory diff --git a/contributing.md b/contributing.md index 8819553..0a7b896 100644 --- a/contributing.md +++ b/contributing.md @@ -3,9 +3,6 @@ Testing Locally: ```shell -asdf plugin test [--asdf-tool-version ] [--asdf-plugin-gitref ] [test-command*] - -# TODO: adapt this asdf plugin test signal-cli https://github.com/ehsash/asdf-signal-cli.git "signal-cli --version" ``` diff --git a/lib/utils.bash b/lib/utils.bash old mode 100644 new mode 100755 index b5872fb..754d285 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -2,7 +2,6 @@ set -euo pipefail -# TODO: Ensure this is the correct GitHub homepage where releases can be downloaded for signal-cli. GH_REPO="https://github.com/AsamK/signal-cli" TOOL_NAME="signal-cli" TOOL_TEST="signal-cli --version" @@ -14,7 +13,6 @@ fail() { curl_opts=(-fsSL) -# NOTE: You might want to remove this if signal-cli is not hosted on GitHub releases. if [ -n "${GITHUB_API_TOKEN:-}" ]; then curl_opts=("${curl_opts[@]}" -H "Authorization: token $GITHUB_API_TOKEN") fi @@ -27,12 +25,10 @@ sort_versions() { list_github_tags() { git ls-remote --tags --refs "$GH_REPO" | grep -o 'refs/tags/.*' | cut -d/ -f3- | - sed 's/^v//' # NOTE: You might want to adapt this sed to remove non-version strings from tags + sed 's/^v//' } list_all_versions() { - # TODO: Adapt this. By default we simply list the tag names from GitHub releases. - # Change this function if signal-cli has other means of determining installable versions. list_github_tags } @@ -41,8 +37,7 @@ download_release() { version="$1" filename="$2" - # TODO: Adapt the release URL convention for signal-cli - url="$GH_REPO/archive/v${version}.tar.gz" + url="${GH_REPO}/releases/download/v${version}/${TOOL_NAME}-${version}.tar.gz" echo "* Downloading $TOOL_NAME release $version..." curl "${curl_opts[@]}" -o "$filename" -C - "$url" || fail "Could not download $url" @@ -51,7 +46,7 @@ download_release() { install_version() { local install_type="$1" local version="$2" - local install_path="${3%/bin}/bin" + local install_path="${3%/bin}" if [ "$install_type" != "version" ]; then fail "asdf-$TOOL_NAME supports release installs only" @@ -59,12 +54,12 @@ install_version() { ( mkdir -p "$install_path" + cp -r "$ASDF_DOWNLOAD_PATH"/* "$install_path" - # TODO: Assert signal-cli executable exists. local tool_cmd tool_cmd="$(echo "$TOOL_TEST" | cut -d' ' -f1)" - test -x "$install_path/$tool_cmd" || fail "Expected $install_path/$tool_cmd to be executable." + test -x "$install_path/bin/$tool_cmd" || fail "Expected $install_path/bin/$tool_cmd to be executable." echo "$TOOL_NAME $version installation was successful!" ) || ( From 7dc859a0f70fffc7af73f889e363fc46672df32b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Jan 2025 06:33:33 +0000 Subject: [PATCH 2/2] Bump amannn/action-semantic-pull-request from 5.2.0 to 5.5.3 Bumps [amannn/action-semantic-pull-request](https://github.com/amannn/action-semantic-pull-request) from 5.2.0 to 5.5.3. - [Release notes](https://github.com/amannn/action-semantic-pull-request/releases) - [Changelog](https://github.com/amannn/action-semantic-pull-request/blob/main/CHANGELOG.md) - [Commits](https://github.com/amannn/action-semantic-pull-request/compare/v5.2.0...v5.5.3) --- updated-dependencies: - dependency-name: amannn/action-semantic-pull-request dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .github/workflows/semantic-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml index 8b26fa4..796f090 100644 --- a/.github/workflows/semantic-pr.yml +++ b/.github/workflows/semantic-pr.yml @@ -11,7 +11,7 @@ jobs: semantic-pr: runs-on: ubuntu-latest steps: - - uses: amannn/action-semantic-pull-request@v5.2.0 + - uses: amannn/action-semantic-pull-request@v5.5.3 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: