1
0
Fork 0
mirror of https://code.forgejo.org/actions/setup-forgejo synced 2024-09-19 01:46:16 +00:00

helper to compile from source

This commit is contained in:
Earl Warren 2023-04-05 14:49:04 +02:00
parent e97991ef78
commit 05c2b60cc5
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00

View file

@ -9,6 +9,36 @@ DIR=$(mktemp -d)
trap "rm -fr $DIR" EXIT
function dependency_go() {
if ! which go > /dev/null ; then
apt-get update
apt-get install -y -qq wget tar
wget https://go.dev/dl/go1.20.3.linux-amd64.tar.gz
tar zxf go1.20.3.linux-amd64.tar.gz
export PATH=$PATH:$(pwd)/go/bin
fi
}
function checkout() {
local git="$1"
if ! test -d forgejo-runner ; then
git clone $git forgejo-runner
fi
}
function build() {
local git="$1"
local version="$2"
(
checkout "$git"
cd forgejo-runner
git checkout "$version"
make build
export PATH=$PATH:$(pwd)
)
}
function api() {
method=$1
shift