diff options
author | Andrew Clemons <andrew.clemons@gmail.com> | 2023-12-15 22:53:41 +0900 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-12-15 22:14:08 +0700 |
commit | de2523f86f5eff87e34f7a65479d1302582f17fb (patch) | |
tree | 86cc06b828f6515afeb73e6e433c5994a0e02454 /development | |
parent | 41465ae83ff73fadd482be0db515af6d7f0a7bd9 (diff) |
development/actionlint: Added (GitHub Actions workflow files linter).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development')
-rw-r--r-- | development/actionlint/README | 4 | ||||
-rw-r--r-- | development/actionlint/actionlint.SlackBuild | 181 | ||||
-rw-r--r-- | development/actionlint/actionlint.info | 32 | ||||
-rw-r--r-- | development/actionlint/slack-desc | 19 |
4 files changed, 236 insertions, 0 deletions
diff --git a/development/actionlint/README b/development/actionlint/README new file mode 100644 index 0000000000000..f7463c0acc0c0 --- /dev/null +++ b/development/actionlint/README @@ -0,0 +1,4 @@ +actionlint - Static checker for GitHub Actions workflow files + +NOTE: google-go-lang is only needed at compile time - not at runtime. + ronn is a build only dependency for creating the man page. diff --git a/development/actionlint/actionlint.SlackBuild b/development/actionlint/actionlint.SlackBuild new file mode 100644 index 0000000000000..0d2488c76397e --- /dev/null +++ b/development/actionlint/actionlint.SlackBuild @@ -0,0 +1,181 @@ +#!/bin/bash + +# Slackware build script for actionlint + +# Copyright 2023 Andrew Clemons, Tokyo Japan +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=actionlint +VERSION=${VERSION:-1.6.26} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION + +mkdir -p vendor/github.com + +for DEPENDENCY in fatih/color/1.15.0 \ + google/go-cmp/0.5.9 \ + mattn/go-colorable/0.1.13 \ + mattn/go-isatty/0.0.19 \ + mattn/go-runewidth/0.0.15 \ + rivo/uniseg/0.4.4 \ + robfig/cron/3.0.1 \ + yuin/goldmark/1.5.6 ; do + DEPENDENCY_OWNER="$(echo "$DEPENDENCY" | cut -d/ -f1)" + DEPENDENCY_NAME="$(echo "$DEPENDENCY" | cut -d/ -f2)" + DEPENDENCY_REV="$(echo "$DEPENDENCY" | cut -d/ -f3)" + + mkdir -p "vendor/github.com/$DEPENDENCY_OWNER" + + tar xf "$CWD/$DEPENDENCY_NAME-$DEPENDENCY_REV.tar.gz" + + if [ "$DEPENDENCY_NAME" = "cron" ] ; then + mkdir "vendor/github.com/$DEPENDENCY_OWNER/$DEPENDENCY_NAME/" + mv "$DEPENDENCY_NAME-$DEPENDENCY_REV" "vendor/github.com/$DEPENDENCY_OWNER/$DEPENDENCY_NAME/v3" + else + mv "$DEPENDENCY_NAME-$DEPENDENCY_REV" "vendor/github.com/$DEPENDENCY_OWNER/$DEPENDENCY_NAME" + fi +done + +mkdir -p vendor/golang.org/x +for DEPENDENCY in sync/0.3.0 \ + sys/0.12.0 ; do + DEPENDENCY_NAME="$(echo "$DEPENDENCY" | cut -d/ -f1)" + DEPENDENCY_REV="$(echo "$DEPENDENCY" | cut -d/ -f2)" + + tar xf "$CWD/$DEPENDENCY_NAME-$DEPENDENCY_REV.tar.gz" + mv "$DEPENDENCY_NAME-$DEPENDENCY_REV" "vendor/golang.org/x/$DEPENDENCY_NAME" +done + +mkdir -p vendor/gopkg.in +tar -xf "$CWD/yaml-3.0.1.tar.gz" +mv yaml-3.0.1 "vendor/gopkg.in/yaml.v3" + +cat << EOF > vendor/modules.txt +# github.com/fatih/color v1.15.0 +## explicit; go 1.17 +github.com/fatih/color +# github.com/google/go-cmp v0.5.9 +## explicit; go 1.13 +github.com/google/go-cmp/cmp +github.com/google/go-cmp/cmp/cmpopts +github.com/google/go-cmp/cmp/internal/diff +github.com/google/go-cmp/cmp/internal/flags +github.com/google/go-cmp/cmp/internal/function +github.com/google/go-cmp/cmp/internal/value +# github.com/mattn/go-colorable v0.1.13 +## explicit; go 1.15 +github.com/mattn/go-colorable +# github.com/mattn/go-isatty v0.0.19 +## explicit; go 1.15 +github.com/mattn/go-isatty +# github.com/mattn/go-runewidth v0.0.15 +## explicit; go 1.9 +github.com/mattn/go-runewidth +# github.com/rivo/uniseg v0.4.4 +## explicit; go 1.18 +github.com/rivo/uniseg +# github.com/robfig/cron/v3 v3.0.1 +## explicit; go 1.12 +github.com/robfig/cron/v3 +# github.com/yuin/goldmark v1.5.6 +## explicit; go 1.18 +github.com/yuin/goldmark +github.com/yuin/goldmark/ast +github.com/yuin/goldmark/extension +github.com/yuin/goldmark/extension/ast +github.com/yuin/goldmark/parser +github.com/yuin/goldmark/renderer +github.com/yuin/goldmark/renderer/html +github.com/yuin/goldmark/text +github.com/yuin/goldmark/util +# golang.org/x/sync v0.3.0 +## explicit; go 1.17 +golang.org/x/sync/errgroup +golang.org/x/sync/semaphore +# golang.org/x/sys v0.12.0 +## explicit; go 1.17 +golang.org/x/sys/execabs +golang.org/x/sys/internal/unsafeheader +golang.org/x/sys/unix +golang.org/x/sys/windows +# gopkg.in/yaml.v3 v3.0.1 +## explicit +gopkg.in/yaml.v3 +EOF + +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +go build -ldflags "-s -w -X github.com/rhysd/actionlint.version=$VERSION" -mod=vendor ./cmd/actionlint +install -D -m0755 actionlint $PKG/usr/bin/actionlint + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +ronn man/actionlint.1.ronn +install -D -m0644 man/actionlint.1 $PKG/usr/man/man1/actionlint.1 + +find $PKG/usr/man -type f -exec gzip -9 {} \; +for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a \ + CHANGELOG.md CONTRIBUTING.md LICENSE.txt README.md docs \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/development/actionlint/actionlint.info b/development/actionlint/actionlint.info new file mode 100644 index 0000000000000..fd503fe512c13 --- /dev/null +++ b/development/actionlint/actionlint.info @@ -0,0 +1,32 @@ +PRGNAM="actionlint" +VERSION="1.6.26" +HOMEPAGE="https://github.com/rhysd/actionlint" +DOWNLOAD="https://github.com/rhysd/actionlint/archive/v1.6.26/actionlint-1.6.26.tar.gz \ + https://github.com/fatih/color/archive/v1.15.0/color-1.15.0.tar.gz \ + https://github.com/google/go-cmp/archive/v0.5.9/go-cmp-0.5.9.tar.gz \ + https://github.com/mattn/go-colorable/archive/v0.1.13/go-colorable-0.1.13.tar.gz \ + https://github.com/mattn/go-isatty/archive/v0.0.19/go-isatty-0.0.19.tar.gz \ + https://github.com/mattn/go-runewidth/archive/v0.0.15/go-runewidth-0.0.15.tar.gz \ + https://github.com/rivo/uniseg/archive/v0.4.4/uniseg-0.4.4.tar.gz \ + https://github.com/robfig/cron/archive/v3.0.1/cron-3.0.1.tar.gz \ + https://github.com/yuin/goldmark/archive/v1.5.6/goldmark-1.5.6.tar.gz \ + https://github.com/golang/sync/archive/v0.3.0/sync-0.3.0.tar.gz \ + https://github.com/golang/sys/archive/v0.12.0/sys-0.12.0.tar.gz \ + https://github.com/go-yaml/yaml/archive/v3.0.1/yaml-v3.0.1.tar.gz" +MD5SUM="d82818a76937c580dd49484b0d696f02 \ + bbcacdbbcd5aa2ce8c9452e0e27dd506 \ + d7242286134017c8485a26f6f3dd1bb8 \ + ac74020d881d4966e33ab6580f509aeb \ + e10ea58c2288fbef0d8ea37dea93718a \ + 3da9ee6fafe706e99bd88ac86023f6a5 \ + 4e272ceb8899ee895e425f16347d10a6 \ + 6165823364bc3bd568d3a6a1dee6c2cb \ + a03711e3db4a90fd0152fa1c93fe7990 \ + 6ee84936506a6cbc435097fc746679cb \ + 7e83667ccb1e6bd511eeee214f82c65c \ + 3653fca1491a8b432d590ed3dab3aa77" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="google-go-lang rubygem-ronn" +MAINTAINER="Andrew Clemons" +EMAIL="andrew.clemons@gmail.com" diff --git a/development/actionlint/slack-desc b/development/actionlint/slack-desc new file mode 100644 index 0000000000000..15eb006f9a5d1 --- /dev/null +++ b/development/actionlint/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +actionlint: actionlint (Static checker for GitHub Actions workflow files) +actionlint: +actionlint: actionlint is a static checker for GitHub Actions workflow files. +actionlint: +actionlint: https://github.com/rhysd/actionlint +actionlint: +actionlint: +actionlint: +actionlint: +actionlint: +actionlint: |