drone-gitea-release/.drone.yml
RaviAnand Mohabir 145a6acad5 ci: 👷 run publish Docker image pipeline on tag
- Allow failure of bump pipeline as changelog won't be generated if no version bump is possible
2024-06-25 14:48:42 +02:00

65 lines
1.6 KiB
YAML

kind: pipeline
type: kubernetes
name: tag and create release
steps:
- name: bump tag
image: python:3.12
commands:
- git config --global user.email "drone@dikurium.ch"
- git config --global user.name "Drone"
- git config --global url."https://$GIT_USERNAME:$GIT_PASSWORD@gitea.dikurium.ch/".insteadOf "https://gitea.dikurium.ch/"
- git config --global --add --bool push.autoSetupRemote true
- git fetch --tags
- pip install -U Commitizen
- cz bump --annotated-tag --yes
- git push --follow-tags
- cz changelog $(cz version -p) > CZ_CURRENT_CHANGELOG.md
environment:
GIT_USERNAME:
from_secret: git_username
GIT_PASSWORD:
from_secret: git_password
failure: ignore
- image: gitea.dikurium.ch/innopeak/drone-gitea-release
name: create release
settings:
gitea_password:
from_secret: git_password
gitea_url: gitea.dikurium.ch
gitea_username:
from_secret: git_username
notes_file: CZ_CURRENT_CHANGELOG.md
owner: innopeak
repo: drone-gitea-release
depends_on:
- bump tag
trigger:
branch:
- main
event:
- push
---
kind: pipeline
type: kubernetes
name: publish Docker image
steps:
- name: publish Docker image
image: plugins/docker
settings:
registry: gitea.dikurium.ch
repo: gitea.dikurium.ch/innopeak/drone-gitea-release
auto_tag: true
username:
from_secret: docker_username
password:
from_secret: docker_password
trigger:
branch:
- main
event:
- tag