#!/bin/sh
rm -rf gitea
mkdir gitea
export GOPATH=`pwd`/gitea
git clone --depth 1 https://github.com/go-gitea/gitea $GOPATH/src/github.com/go-gitea/gitea
( cd $GOPATH/src/github.com/go-gitea/gitea
  #go get -v -d
  go mod download
)
#go get -v -d -tags "sqlite" code.gitea.io/gitea
tar cf - --exclude .git --exclude .hg --exclude .svn gitea | xz -9 >gitea-`date '+%Y%m%d'`.tar.xz
rm -rf gitea
