mirror of
https://code.forgejo.org/actions/setup-forgejo.git
synced 2024-11-24 03:30:57 -05:00
helper to compile from source
This commit is contained in:
parent
e97991ef78
commit
05c2b60cc5
1 changed files with 30 additions and 0 deletions
|
@ -9,6 +9,36 @@ DIR=$(mktemp -d)
|
||||||
|
|
||||||
trap "rm -fr $DIR" EXIT
|
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() {
|
function api() {
|
||||||
method=$1
|
method=$1
|
||||||
shift
|
shift
|
||||||
|
|
Loading…
Reference in a new issue