120 lines
3.4 KiB
YAML
120 lines
3.4 KiB
YAML
platform: linux/amd64
|
|
|
|
depends_on:
|
|
- compliance-and-tests
|
|
|
|
workspace:
|
|
base: /source
|
|
path: /
|
|
|
|
pipeline:
|
|
fetch-tags:
|
|
image: docker:git
|
|
pull: true
|
|
commands:
|
|
- git config --add safe.directory '*'
|
|
- git fetch --tags --force
|
|
|
|
deps-frontend:
|
|
image: node:18
|
|
pull: true
|
|
commands:
|
|
- test "$${GOPROXY_OVERRIDE-}" != "" && export GOPROXY="$${GOPROXY_OVERRIDE}"
|
|
- make deps-frontend
|
|
secrets:
|
|
- goproxy_override
|
|
|
|
deps-backend:
|
|
image: golang:1.19
|
|
pull: true
|
|
commands:
|
|
- test "$${GOPROXY_OVERRIDE-}" != "" && export GOPROXY="$${GOPROXY_OVERRIDE}"
|
|
- make deps-backend
|
|
secrets:
|
|
- goproxy_override
|
|
|
|
build-static:
|
|
image: techknowlogick/xgo:go-1.19.x
|
|
pull: true
|
|
commands:
|
|
- test "$${GOPROXY_OVERRIDE-}" != "" && export GOPROXY="$${GOPROXY_OVERRIDE}"
|
|
- export WS_BASE="$(pwd)"
|
|
- echo "installing nodejs"
|
|
- curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
|
|
- echo "fetching upx"
|
|
- cd /usr/local/bin
|
|
- curl -sL https://github.com/upx/upx/releases/download/v$${UPXVERSION}/upx-$${UPXVERSION}-amd64_linux.tar.xz | tar --strip-components 1 -xJf - upx-$${UPXVERSION}-amd64_linux/upx
|
|
- echo "checking upx"
|
|
- test -f /usr/local/bin/upx || exit 1
|
|
- export PATH=$PATH:$GOPATH/bin
|
|
- echo "building forgejo"
|
|
- cd $WS_BASE
|
|
- make CI=true LINUX_ARCHS=$${LINUX_ARCHS} release
|
|
- echo "building environment-to-ini"
|
|
- export TAGS=bindata
|
|
- cd $WS_BASE/contrib/environment-to-ini
|
|
- make CI=true LINUX_ARCHS=$${LINUX_ARCHS} release
|
|
environment:
|
|
TAGS: bindata sqlite sqlite_unlock_notify
|
|
DEBIAN_FRONTEND: noninteractive
|
|
UXPVERSION: 4.0.1
|
|
LINUX_ARCHS: 'linux/amd64,linux/arm64'
|
|
secrets:
|
|
- goproxy_override
|
|
|
|
prep-multiarch-binaries:
|
|
image: golang:1.19 # image reuse to reduce pull times, go not required
|
|
pull: true
|
|
environment:
|
|
fallbackversion: main # the fallback version used by make
|
|
commands:
|
|
- mkdir docker/bin
|
|
- ./docker/map-binaries.sh ./dist/binaries forgejo ${CI_COMMIT_TAG##v}
|
|
- ./docker/map-binaries.sh ./dist/contrib environment-to-ini ${CI_COMMIT_TAG##v}
|
|
when:
|
|
event: tag
|
|
|
|
build-docker:
|
|
image: woodpeckerci/plugin-docker-buildx
|
|
pull: true
|
|
settings:
|
|
dockerfile: Dockerfile.ci
|
|
platforms: linux/amd64,linux/arm64
|
|
registry:
|
|
from_secret: domain
|
|
tag: ${CI_COMMIT_TAG##v}
|
|
repo: ${CI_REPO_LINK##https://}
|
|
password:
|
|
from_secret: releaseteamtoken
|
|
username:
|
|
from_secret: releaseteamuser
|
|
when:
|
|
event: tag
|
|
|
|
gpg-sign:
|
|
image: plugins/gpgsign:1
|
|
pull: true
|
|
settings:
|
|
detach_sign: true
|
|
excludes:
|
|
- "dist/release/*.sha256"
|
|
files:
|
|
- "dist/release/*"
|
|
key:
|
|
from_secret: releaseteamgpg
|
|
when:
|
|
event: tag
|
|
|
|
release:
|
|
image: golang:1.19
|
|
commands:
|
|
- curl -sL https://dl.gitea.io/tea/0.9.0/tea-0.9.0-linux-amd64 > /bin/tea && chmod +x /bin/tea
|
|
- REMOTE=$(echo $CI_REPO_LINK | sed -e 's|.*://||' -e 's|/.*||')
|
|
- GITEA_SERVER_URL=$CI_REPO_LINK GITEA_SERVER_TOKEN=$RELEASETEAMTOKEN tea login add --name $RELEASETEAMUSER --url $REMOTE
|
|
- ASSETS=$(ls dist/release/* | sed -e 's/^/-a /')
|
|
- tea release create $ASSETS --tag $CI_COMMIT_TAG --title $CI_COMMIT_TAG
|
|
when:
|
|
event: tag
|
|
secrets:
|
|
- releaseteamtoken
|
|
- releaseteamuser
|