Add '.drone.yml'
This commit is contained in:
parent
131c5bbaa8
commit
cea6a4a8aa
151
.drone.yml
Normal file
151
.drone.yml
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
kind: pipeline
|
||||||
|
name: default
|
||||||
|
type: docker
|
||||||
|
steps:
|
||||||
|
- name: post build in progress comment to PR
|
||||||
|
image: tsakidev/giteacomment:latest
|
||||||
|
settings:
|
||||||
|
gitea_token:
|
||||||
|
from_secret: gitea_token
|
||||||
|
gitea_base_url: https://code.garrettmills.dev
|
||||||
|
comment: "Build ${DRONE_BUILD_NUMBER} started."
|
||||||
|
when:
|
||||||
|
event: pull_request
|
||||||
|
|
||||||
|
- name: remove lockfile
|
||||||
|
image: glmdev/node-pnpm:latest
|
||||||
|
commands:
|
||||||
|
- rm -rf pnpm-lock.yaml
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
exclude: tag
|
||||||
|
|
||||||
|
- name: build module
|
||||||
|
image: glmdev/node-pnpm:latest
|
||||||
|
commands:
|
||||||
|
- pnpm i
|
||||||
|
- pnpm build
|
||||||
|
- mkdir artifacts
|
||||||
|
- tar czf artifacts/extollo-PACKAGE.tar.gz lib
|
||||||
|
|
||||||
|
- name: create Gitea release
|
||||||
|
image: plugins/gitea-release
|
||||||
|
settings:
|
||||||
|
api_key:
|
||||||
|
from_secret: gitea_token
|
||||||
|
base_url: https://code.garrettmills.dev
|
||||||
|
checksum: md5
|
||||||
|
title: ${DRONE_TAG}
|
||||||
|
files: "artifacts/*"
|
||||||
|
when:
|
||||||
|
event: tag
|
||||||
|
status: success
|
||||||
|
|
||||||
|
- name: prepare NPM release
|
||||||
|
image: glmdev/node-pnpm:latest
|
||||||
|
commands:
|
||||||
|
- rm -rf artifacts
|
||||||
|
when:
|
||||||
|
event: tag
|
||||||
|
status: success
|
||||||
|
|
||||||
|
- name: create NPM release
|
||||||
|
image: plugins/npm
|
||||||
|
settings:
|
||||||
|
username: extollo_bot
|
||||||
|
password:
|
||||||
|
from_secret: npm_password
|
||||||
|
email: extollo@garrettmills.dev
|
||||||
|
when:
|
||||||
|
event: tag
|
||||||
|
status: success
|
||||||
|
|
||||||
|
- name: send build success notifications
|
||||||
|
image: plugins/webhook
|
||||||
|
settings:
|
||||||
|
urls:
|
||||||
|
from_secret: notify_webhook_url
|
||||||
|
content_type: application/json
|
||||||
|
template: |
|
||||||
|
{
|
||||||
|
"title": "Drone-CI [extollo/PACKAGE @ ${DRONE_BUILD_NUMBER}]",
|
||||||
|
"message": "Build completed successfully.",
|
||||||
|
"priority": 4
|
||||||
|
}
|
||||||
|
when:
|
||||||
|
status: success
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- pull_request
|
||||||
|
- tag
|
||||||
|
|
||||||
|
- name: send publish success notifications
|
||||||
|
image: plugins/webhook
|
||||||
|
settings:
|
||||||
|
urls:
|
||||||
|
from_secret: notify_webhook_url
|
||||||
|
content_type: application/json
|
||||||
|
template: |
|
||||||
|
{
|
||||||
|
"title": "Drone-CI [extollo/PACKAGE @ ${DRONE_BUILD_NUMBER}]",
|
||||||
|
"message": "Successfully published tag ${DRONE_TAG}.",
|
||||||
|
"priority": 4
|
||||||
|
}
|
||||||
|
when:
|
||||||
|
status: success
|
||||||
|
event: tag
|
||||||
|
|
||||||
|
- name: post build success comment to PR
|
||||||
|
image: tsakidev/giteacomment:latest
|
||||||
|
settings:
|
||||||
|
gitea_token:
|
||||||
|
from_secret: gitea_token
|
||||||
|
gitea_base_url: https://code.garrettmills.dev
|
||||||
|
comment: "Build ${DRONE_BUILD_NUMBER} completed successfully."
|
||||||
|
when:
|
||||||
|
status: success
|
||||||
|
event: pull_request
|
||||||
|
|
||||||
|
- name: send build error notifications
|
||||||
|
image: plugins/webhook
|
||||||
|
settings:
|
||||||
|
urls:
|
||||||
|
from_secret: notify_webhook_url
|
||||||
|
content_type: application/json
|
||||||
|
template: |
|
||||||
|
{
|
||||||
|
"title": "Drone-CI [extollo/PACKAGE @ ${DRONE_BUILD_NUMBER}]",
|
||||||
|
"message": "Build failed!",
|
||||||
|
"priority": 6
|
||||||
|
}
|
||||||
|
when:
|
||||||
|
status: failure
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
- name: post build error comment to PR
|
||||||
|
image: tsakidev/giteacomment:latest
|
||||||
|
settings:
|
||||||
|
gitea_token:
|
||||||
|
from_secret: gitea_token
|
||||||
|
gitea_base_url: https://code.garrettmills.dev
|
||||||
|
comment: "Build ${DRONE_BUILD_NUMBER} failed!"
|
||||||
|
when:
|
||||||
|
status: failure
|
||||||
|
event: pull_request
|
||||||
|
|
||||||
|
- name: trigger documentation build
|
||||||
|
image: plugins/downstream
|
||||||
|
settings:
|
||||||
|
server: https://ci.garrettmills.dev
|
||||||
|
token:
|
||||||
|
from_secret: drone_token
|
||||||
|
fork: false
|
||||||
|
last_successful: true
|
||||||
|
deploy: production
|
||||||
|
repositories:
|
||||||
|
- Extollo/docs@master
|
||||||
|
when:
|
||||||
|
status: success
|
||||||
|
event: tag
|
Loading…
Reference in New Issue
Block a user