diff --git a/bin/check-updates b/bin/check-updates new file mode 100755 index 0000000..fe0868d --- /dev/null +++ b/bin/check-updates @@ -0,0 +1,4 @@ +#!/bin/sh + +nvchecker -c ./nvchecker.toml -l error +nvcmp -c ./nvchecker.toml diff --git a/bin/vendor-and-upload b/bin/vendor-and-upload new file mode 100755 index 0000000..ed08360 --- /dev/null +++ b/bin/vendor-and-upload @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +set -euo pipefail + +# These variables should be set per-instance. +# PLEASE CHANGE THEM. +GITEA_URL="https://git.froth.zone" +OWNER="packaging" +USER="oauth2" # Can be unset if $OWNER is your username or changed to your username. +PACKAGER_NAME="portage" +PACKAGER_VERSION="deps" + +[[ $# -ne 2 ]] && { + echo "Usage: $0 " + exit 1 +} + +PACKAGE_NAME=$1 +PACKAGE_TAG=$2 + +if [[ -z "${GITEA_TOKEN}" ]]; then + if [[ -z "${GITHUB_TOKEN}" ]]; then + echo "Please set GITEA_TOKEN." + exit 1 + fi + GITEA_TOKEN=${GITHUB_TOKEN} +fi + +curl https://github.com/$PACKAGE_NAME/archive/$PACKAGE_TAG.tar.gz -L -O + + +PKG=${PACKAGE_NAME##*/}-${PACKAGE_TAG//v/} + +tar -xzf "$PACKAGE_TAG".tar.gz +rm "$PACKAGE_TAG".tar.gz + +cd "$PKG" || exit 1 + +if [[ -f go.mod ]]; then + go mod vendor + cd .. || exit 1 + tar --create --auto-compress --file "$PKG"-vendor.tar.xz "$PKG"/vendor + rm -rf "$PKG" + curl --user $USER:"$GITEA_TOKEN" --upload-file ./"$PKG"-vendor.tar.xz $GITEA_URL/api/packages/$OWNER/generic/$PACKAGER_NAME/$PACKAGER_VERSION/"$PKG"-vendor.tar.xz + echo "Uploaded $PKG-vendor.tar.xz!" + rm "$PKG"-vendor.tar.xz + exit 0 +else + echo "This package does not have a go.mod file." + exit 1 +fi diff --git a/ver.json b/ver.json index 1751e62..1212c89 100644 --- a/ver.json +++ b/ver.json @@ -1,5 +1,5 @@ { - "goreleaser": "1.22.0", + "goreleaser": "1.25.1", "nfpm": "2.34.0", "wails": "2.6.0", "swag": "1.16.2",