1
0
Fork 0
forgejo-build/.crystalintegration.yml

164 lines
3.8 KiB
YAML

platform: linux/amd64
when:
event: [ push, tag ]
variables:
- &git_image 'bitnami/git:latest'
- &alpine_image 'alpine:latest'
- &golang_image 'golang:1.19'
- &gitea_test_image 'gitea/test_env:linux-amd64'
- &nodejs_image 'node:lts'
- &build_submodule 'forgejo'
- &goproxy_override ''
- &goproxy_setup |-
if [ -n "$${GOPROXY_OVERRIDE:-}" ]; then
export GOPROXY="$${GOPROXY_OVERRIDE}";
echo "Using goproxy from goproxy_override \"$${GOPROXY}\"";
elif [ -n "$${GOPROXY_DEFAULT:-}" ]; then
export GOPROXY="$${GOPROXY_DEFAULT}";
echo "Using goproxy from goproxy_default (secret) not displaying";
else
export GOPROXY="https://proxy.golang.org,direct";
echo "No goproxy overrides or defaults given, using \"$${GOPROXY}\"";
fi
workspace:
base: /go
path: src/cryxtal/forgejo-crystal-build
clone:
clone-recursive:
image: woodpeckerci/plugin-git
settings:
recursive: true
pipeline:
fetch-tags:
image: *git_image
pull: true
commands:
- git config --add safe.directory '*'
- git fetch --tags --force
- git submodule foreach 'git fetch --tags --force'
ci-verify:
image: *alpine_image
group: deps
environment:
BUILD_SUBMODULE: *build_submodule
commands:
- apk update
- apk add curl jq git
- ./.ci-verify.sh $BUILD_SUBMODULE
deps-frontend:
image: *nodejs_image
group: deps
environment:
BUILD_SUBMODULE: *build_submodule
commands:
- cd "$BUILD_SUBMODULE"
- make deps-frontend
deps-backend:
image: *golang_image
group: deps
environment:
BUILD_SUBMODULE: *build_submodule
GOPROXY_OVERRIDE: *goproxy_override
secrets:
- goproxy_default
commands:
- *goproxy_setup
- cd "$BUILD_SUBMODULE"
- make deps-backend
tag-pre-condition:
image: *git_image
environment:
BUILD_SUBMODULE: *build_submodule
commands:
- cd "$BUILD_SUBMODULE"
- git update-ref refs/heads/tag_test $(git rev-parse --verify HEAD)
security-check:
image: *golang_image
group: checks
environment:
BUILD_SUBMODULE: *build_submodule
GOPROXY_OVERRIDE: *goproxy_override
secrets:
- goproxy_default
commands:
- *goproxy_setup
- cd "$BUILD_SUBMODULE"
- make security-check
build-frontend:
image: *nodejs_image
group: checks
environment:
BUILD_SUBMODULE: *build_submodule
commands:
- cd "$BUILD_SUBMODULE"
- make frontend
checks-backend:
image: *gitea_test_image
group: checks
environment:
BUILD_SUBMODULE: *build_submodule
GOPROXY_OVERRIDE: *goproxy_override
secrets:
- goproxy_default
commands:
- *goproxy_setup
- cd "$BUILD_SUBMODULE"
- make --always-make checks-backend
build-forgejo-amd64:
image: *golang_image
environment:
BUILD_SUBMODULE: *build_submodule
GOSUMDB: sum.golang.org
TAGS: bindata
GOPROXY_OVERRIDE: *goproxy_override
secrets:
- goproxy_default
commands:
- *goproxy_setup
- cd "$BUILD_SUBMODULE"
- make build
- mv gitea ../forgejo-bin
build-forgejo-sqlite-amd64:
image: *golang_image
environment:
BUILD_SUBMODULE: *build_submodule
GOSUMDB: sum.golang.org
TAGS: bindata sqlite sqlite_unlock_notify
GOPROXY_OVERRIDE: *goproxy_override
secrets:
- goproxy_default
commands:
- *goproxy_setup
- cd "$BUILD_SUBMODULE"
- make build
- mv gitea ../forgejo-sqlite-bin
upload-crystalcommit:
image: woodpeckerci/plugin-gitea-release
group: upload
settings:
base_url: https://sc.cryxtal.org
files:
- "forgejo-bin"
- "forgejo-sqlite-bin"
api_key:
from_secret: sc_api_key
prerelease: false
skip_verify: true
when:
event: [ tag ]