Skip to content

Commit

Permalink
Merge pull request #9 from asdf-community/update-ci
Browse files Browse the repository at this point in the history
Update CI
  • Loading branch information
smorimoto authored Mar 14, 2023
2 parents 0ef783f + 4907d05 commit 94886d0
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 85 deletions.
53 changes: 0 additions & 53 deletions .github/workflows/aio.yml

This file was deleted.

25 changes: 25 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test Plugin

on:
pull_request:
push:
schedule:
- cron: 0 1 * * MON

jobs:
test-plugin:
name: Test Plugin

strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest

runs-on: ${{ matrix.os }}

steps:
- uses: asdf-vm/actions/plugin-test@v2
with:
command: ark version
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
SRCFILES = $(shell git ls-files "bin/**")
SHFMT_BASE_FLAGS = -s -i 2 -ci

format:
shfmt -w $(SHFMT_BASE_FLAGS) $(SRCFILES)
.PHONY: format

format-check:
shfmt -d $(SHFMT_BASE_FLAGS) $(SRCFILES)
.PHONY: format-check

lint:
shellcheck $(SRCFILES)
.PHONY: lint
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# asdf-arkade

![AllInOne](https://github.com/asdf-community/asdf-arkade/workflows/AllInOne/badge.svg)
[![GitHub license](https://img.shields.io/github/license/asdf-community/asdf-arkade?style=plastic)](https://github.com/asdf-community/asdf-arkade/blob/master/LICENSE)

## Build History

[![Build history](https://buildstats.info/github/chart/asdf-community/asdf-arkade?branch=master)](https://github.com/asdf-community/asdf-arkade/actions)

## arkade

<https://github.com/alexellis/arkade>
Expand All @@ -27,7 +22,4 @@ This source code has been generated with :

```bash
cookiecutter --overwrite-if-exists --directory plugins/arkade --no-input https://github.com/looztra/cookiecutter-asdf-plugin

```


28 changes: 14 additions & 14 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ function log() {
line="[$(date '+%F %T')] $level: $*"
if [ -t 2 ]; then
case "$level" in
INFO) code=36 ;;
DEBUG) code=35 ;;
WARN) code=33 ;;
ERROR) code=31 ;;
*) code=37 ;;
INFO) code=36 ;;
DEBUG) code=35 ;;
WARN) code=33 ;;
ERROR) code=31 ;;
*) code=37 ;;
esac
echo -e "\e[${code}m${line} \e[94m(${FUNCNAME[1]})\e[0m"
else
Expand All @@ -53,7 +53,7 @@ function log() {

# from https://stackoverflow.com/questions/4023830/how-to-compare-two-strings-in-dot-separated-version-format-in-bash
function vercomp() {
if [[ "$1" == "$2" ]]; then
if [[ $1 == "$2" ]]; then
return 0
fi
local IFS=.
Expand Down Expand Up @@ -91,14 +91,14 @@ install_tool() {
local bin_install_path="$install_path/bin"
local full_path_to_binary="$bin_install_path/${binary_name}"
local full_path_to_alt_binary
if [[ -n "$binary_alt_name" || "$binary_alt_name" == "$NO_BINARY_ALTNAME" ]]; then
if [[ -n $binary_alt_name || $binary_alt_name == "$NO_BINARY_ALTNAME" ]]; then
full_path_to_alt_binary="$bin_install_path/${binary_alt_name}"
fi
local download_url
local download_target_file
local download_sub_path_dir

if [[ "$install_type" != "version" ]]; then
if [[ $install_type != "version" ]]; then
log ERROR "Install of type [$install_type] not supported"
fi

Expand All @@ -116,10 +116,10 @@ install_tool() {

log INFO "Cleaning previous binaries if any"
rm -f "$full_path_to_binary" 2>/dev/null || true
if [[ -n "$binary_alt_name" ]]; then
if [[ -n $binary_alt_name ]]; then
rm -f "$full_path_to_alt_binary" 2>/dev/null || true
fi
if [[ "$downloaded_file_is_not_an_archive" != "true" ]]; then
if [[ $downloaded_file_is_not_an_archive != "true" ]]; then
log INFO "Extracting archive"
tar xpf "$download_target_file" -C "$tmp_download_dir"
else
Expand All @@ -129,7 +129,7 @@ install_tool() {
log INFO "Copying binaries"
cp "$(get_binary_path_in_archive "${tmp_download_dir}" "${binary_name}" "${version}" "${platform}")" "${full_path_to_binary}"
chmod +x "${full_path_to_binary}"
if [[ -n "$binary_alt_name" ]]; then
if [[ -n $binary_alt_name ]]; then
cp "${full_path_to_binary}" "${full_path_to_alt_binary}"
chmod +x "${full_path_to_alt_binary}"
fi
Expand Down Expand Up @@ -159,9 +159,9 @@ get_platform() {
get_platform_custom() {
local operating_system
operating_system=$(uname | tr '[:upper:]' '[:lower:]')
if [[ "$operating_system" == "linux" ]]; then
if [[ $operating_system == "linux" ]]; then
echo ""
elif [[ "$operating_system" == "darwin" ]]; then
elif [[ $operating_system == "darwin" ]]; then
echo "-darwin"
else
log ERROR "Unsupported value for operating_system [$operating_system]"
Expand Down Expand Up @@ -208,6 +208,6 @@ get_download_url() {
}

#
readonly _tmp_download_dir="$(mktemp -d -t 'asdf_XXXXXXXX')"
_tmp_download_dir="$(mktemp -d -t 'asdf_XXXXXXXX')"
trap 'rm -rf "${_tmp_download_dir}"' EXIT
install_tool "$ASDF_INSTALL_TYPE" "$ASDF_INSTALL_VERSION" "$ASDF_INSTALL_PATH" "$_tmp_download_dir" "$g_binary_name" "$g_binary_altname" "$g_downloaded_file_is_not_an_archive"
2 changes: 1 addition & 1 deletion bin/list-all
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ function sort_versions() {
}

# Fetch all tag names, and get only second column. Then remove all unnecesary characters.
versions=$(eval "$cmd" | grep -oE "tag_name\": *\".{1,15}\"," | sed 's/tag_name\": *\"//;s/\",//' | sed 's/^v//' | sort_versions)
versions=$(eval "$cmd" | grep -oE 'tag_name": *".{1,15}",' | sed 's/tag_name\": *\"//;s/\",//' | sed 's/^v//' | sort_versions)
# shellcheck disable=SC2086
echo $versions
4 changes: 4 additions & 0 deletions renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:base", "schedule:daily"]
}
9 changes: 0 additions & 9 deletions test/default.bats

This file was deleted.

0 comments on commit 94886d0

Please sign in to comment.