Add some helpers :)
pkgcheck / build (push) Failing after 1m5s Details

This commit is contained in:
Sam Therapy 2024-04-19 21:52:24 +02:00
parent 93c52178b9
commit cc2d715548
Signed by: sam
GPG Key ID: 4D8B07C18F31ACBD
3 changed files with 55 additions and 1 deletions

4
bin/check-updates Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
nvchecker -c ./nvchecker.toml -l error
nvcmp -c ./nvchecker.toml

50
bin/vendor-and-upload Executable file
View File

@ -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 <package> <tag>"
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

View File

@ -1,5 +1,5 @@
{
"goreleaser": "1.22.0",
"goreleaser": "1.25.1",
"nfpm": "2.34.0",
"wails": "2.6.0",
"swag": "1.16.2",