Files
ATM8/.drone.yml
Adrian Marquis 01a8925971
All checks were successful
continuous-integration/drone/tag Build is passing
Added Build Notfication
2023-07-11 23:29:53 +02:00

104 lines
2.5 KiB
YAML

---
kind: "pipeline"
type: "docker"
name: "Create Release from tag"
trigger:
event:
- "tag"
volumes:
- name: "tmp"
temp: {}
- name: "server"
temp: {}
- name: "client"
temp: {}
- name: "curse"
temp: {}
steps:
- name: "Run build tool"
image: "gitea.marquis.site/operations/modpack_buildah"
settings:
modpack__version: "${DRONE_TAG}"
curseforge_apikey:
from_secret: "curseforge_apikey"
volumes:
- name: "server"
path: "/out/server"
- name: "client"
path: "/out/client"
- name: "curse"
path: "/out/curse"
- name: "tmp"
path: "/tmp/modpack_buildah"
- name: "Build and push server container image"
image: "plugins/docker"
privileged: true
settings:
dockerfile: "/out/server/Dockerfile"
context: "/out/server"
registry: "gitea.marquis.site"
repo: "gitea.marquis.site/minecraft/atm8"
username: "drone-ci"
password:
from_secret: "gitea_registry_password"
tags:
- "${DRONE_COMMIT_SHA:0:8}"
- "latest"
- "${DRONE_TAG}"
volumes:
- name: "server"
path: "/out/server"
- name: "Update client files in repository"
image: "alpine/git"
commands:
- "git fetch origin +refs/heads/master"
- "git checkout master"
- "rm -rf ./minecraft/mods"
- "cp -r /out/client/* ."
volumes:
- name: "client"
path: "/out/client"
- name: "Push new client version to repository"
image: "appleboy/drone-git-push"
settings:
branch: "master"
remote_name: "origin"
author_name: "${DRONE_COMMIT_AUTHOR_NAME}"
commit: true
commit_message: "Version ${DRONE_TAG}"
- name: "Create Gitea Release for Curse Modpack"
image: "plugins/gitea-release"
settings:
base_url: "https://gitea.marquis.site"
title: "Version ${DRONE_TAG}"
files: "/out/curse/*-${DRONE_TAG}.zip"
api_key:
from_secret: "gitea_registry_password"
note: >
Modpack Server container image: `gitea.marquis.site/minecraft/atm8:${DRONE_TAG}`
volumes:
- name: "curse"
path: "/out/curse"
- name: "Send notification"
image: "appleboy/drone-telegram"
settings:
token:
from_secret: "drone_telegram_token"
to: -372192466
format: "markdown"
template_vars:
repo_link: "${DRONE_REPO_LINK}"
message: >
Modpack __{{repo.name}}__ just got updated to version __{{ build.tag }}__!
Go to {{ tpl.repo_link }} to get instructions on how to update or
[download the newest Modpack zip directly]({{ tpl.repo_link }}/releases/tag/{{ build.tag }}).