mirror of
https://code.forgejo.org/actions/forgejo-release
synced 2025-11-07 10:56:55 +00:00
Compare commits
2 commits
a91ae74f37
...
854ee4ce4f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
854ee4ce4f | ||
|
|
067e18fae2 |
2 changed files with 40 additions and 6 deletions
|
|
@ -1,7 +1,12 @@
|
||||||
on: [ pull_request, push ]
|
on: [ pull_request, push ]
|
||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
tag: [lts, lts-alpine]
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: "node:${{ matrix.tag }}"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,11 +26,29 @@ TAG_URL=$(echo "$TAG" | sed 's/\//%2F/g')
|
||||||
|
|
||||||
export GNUPGHOME
|
export GNUPGHOME
|
||||||
|
|
||||||
|
get_arch() {
|
||||||
|
local arch
|
||||||
|
arch="$(uname -m)"
|
||||||
|
|
||||||
|
case "$arch" in
|
||||||
|
x86_64) arch="amd64" ;;
|
||||||
|
i386|i686) arch="i386" ;;
|
||||||
|
aarch64) arch="arm64" ;;
|
||||||
|
armv7l) arch="armhf" ;; # Debian uses armhf for hard-float 32-bit ARM
|
||||||
|
armv6l) arch="armel" ;; # older 32-bit ARM
|
||||||
|
riscv64) arch="riscv64" ;;
|
||||||
|
ppc64le) arch="ppc64el" ;;
|
||||||
|
s390x) arch="s390x" ;;
|
||||||
|
*) echo "Unknown architecture: $arch" >&2; return 1 ;;
|
||||||
|
esac
|
||||||
|
echo "$arch"
|
||||||
|
}
|
||||||
|
|
||||||
setup_tea() {
|
setup_tea() {
|
||||||
if which tea 2>/dev/null; then
|
if command -v tea >/dev/null 2>&1; then
|
||||||
TEA_BIN=$(which tea)
|
TEA_BIN=$(command -v tea)
|
||||||
elif ! test -f $TEA_BIN; then
|
elif ! test -f $TEA_BIN; then
|
||||||
ARCH=$(dpkg --print-architecture)
|
ARCH=$(get_arch)
|
||||||
curl -sL https://dl.gitea.io/tea/$TEA_VERSION/tea-$TEA_VERSION-linux-"$ARCH" >$TEA_BIN
|
curl -sL https://dl.gitea.io/tea/$TEA_VERSION/tea-$TEA_VERSION-linux-"$ARCH" >$TEA_BIN
|
||||||
chmod +x $TEA_BIN
|
chmod +x $TEA_BIN
|
||||||
fi
|
fi
|
||||||
|
|
@ -166,9 +184,20 @@ upload() {
|
||||||
}
|
}
|
||||||
|
|
||||||
setup_api() {
|
setup_api() {
|
||||||
if ! which jq curl; then
|
# Check if jq and curl are available
|
||||||
apt-get -qq update
|
if command -v jq >/dev/null 2>&1 && command -v curl >/dev/null 2>&1; then
|
||||||
apt-get install -y -qq jq curl
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "jq and/or curl missing, attempting to install..." >&2
|
||||||
|
|
||||||
|
if command -v apt-get >/dev/null 2>&1; then
|
||||||
|
apt-get -qq update && apt-get install -y -qq jq curl
|
||||||
|
elif command -v apk >/dev/null 2>&1; then
|
||||||
|
apk add --no-cache jq curl
|
||||||
|
else
|
||||||
|
echo "No supported package manager found. Please install jq and curl manually." >&2
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue