forgejo/.woodpecker/release-version.yml
Gapodo d132dbe58e
Some checks failed
ci/woodpecker/tag/compliance-and-tests Pipeline was successful
ci/woodpecker/tag/release-version Pipeline failed
fixed it?
2022-12-07 22:57:03 +01:00

127 lines
3.9 KiB
YAML

platform: linux/amd64
depends_on:
- compliance-and-tests
workspace:
base: /source
path: /
variables:
- &git_image 'docker:git'
- &golang_image 'golang:1.19'
- &node_image 'node:18'
- &xgo_image 'techknowlogick/xgo:go-1.19.x'
- &buildx_plugin_image 'woodpeckerci/plugin-docker-buildx'
- &gpgsign_plugin_image 'plugins/gpgsign:1'
# Docker and XGO platforms may vary in name (arm/v6/v7,...), please make sure,
# that all platforms listed in docker_platforms are also in make_platforms
# for the mapping look at docker/map-binaries.sh
- &make_platforms 'linux/amd64,linux/arm64'
#- &docker_platforms 'linux/amd64,linux/arm64'
# Just building docker for amd64, as codeberg.org/forgejo/alpine:3.17 does not provide arm64
- &docker_platforms 'linux/amd64,linux/arm64'
pipeline:
# fetch-tags:
# image: *git_image
# pull: true
# commands:
# - git config --add safe.directory '*'
# - git fetch --tags --force
# deps-frontend:
# image: *node_image
# pull: true
# commands:
# - make deps-frontend
# deps-backend:
# image: *golang_image
# pull: true
# commands:
# - test "$${GOPROXY_OVERRIDE-}" != "" && export GOPROXY="$${GOPROXY_OVERRIDE}"
# - make deps-backend
# secrets:
# - goproxy_override
# build-static:
# image: *xgo_image
# pull: true
# commands:
# - test "$${GOPROXY_OVERRIDE-}" != "" && export GOPROXY="$${GOPROXY_OVERRIDE}"
# - echo "installing nodejs"
# - curl -sL https://deb.nodesource.com/setup_16.x | bash - && apt-get -qqy install nodejs
# - export PATH=$PATH:$GOPATH/bin
# - echo "building forgejo"
# - make CI=true LINUX_ARCHS=$${LINUX_ARCHS} release
# environment:
# TAGS: bindata sqlite sqlite_unlock_notify
# DEBIAN_FRONTEND: noninteractive
# LINUX_ARCHS: *make_platforms
# secrets:
# - goproxy_override
# gpg-sign:
# image: *gpgsign_plugin_image
# pull: true
# settings:
# detach_sign: true
# excludes:
# - "dist/release/*.sha256"
# files:
# - "dist/release/*"
# key:
# from_secret: releaseteamgpg
# when:
# event: tag
# release:
# image: *golang_image
# 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 /')
# - echo "$${CI_COMMIT_TAG##v}" | grep -qi '\-rc' && export RELEASETYPE="--prerelease" && echo "Uploading as Pre-Release"
# - echo "$${CI_COMMIT_TAG##v}" | grep -qi '\-test' && export RELEASETYPE="--draft" && echo "Uploading as Draft"
# - test $${RELEASETYPE+false} || echo "Uploading as Stable"
# - tea release create $ASSETS --tag $CI_COMMIT_TAG --title $CI_COMMIT_TAG $${RELEASETYPE}
# when:
# event: tag
# secrets:
# - releaseteamtoken
# - releaseteamuser
debug:
image: *golang_image
pull: true
commands:
- env | grep -vi drone | sort -h
- mkdir -p /source/dist/release
- touch /source/dist/release/forgejo-${CI_COMMIT_TAG##v}-linux-arm64
- touch /source/dist/release/forgejo-${CI_COMMIT_TAG##v}-linux-amd64
- mkdir tmp-bin
- cp -r dist/* tmp-bin/
build-docker:
image: *buildx_plugin_image
pull: true
settings:
dockerfile: Dockerfile.ci
platforms: *docker_platforms
registry:
from_secret: domain
tag: ${CI_COMMIT_TAG##v}
repo: ${CI_REPO_LINK##https://}
build_args:
- TAG=${CI_COMMIT_TAG##v}
build_args_from_env:
- CI_REPO_CLONE_URL
- CI_COMMIT_SHA
password:
from_secret: releaseteamtoken
username:
from_secret: releaseteamuser
when:
event: tag