Add drone-pipelines
This commit is contained in:
parent
351ce0cdad
commit
3f5fd10a84
79
.drone.yml
Normal file
79
.drone.yml
Normal file
|
@ -0,0 +1,79 @@
|
||||||
|
name: mantra
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: install
|
||||||
|
image: manuth/silverstripe-dev
|
||||||
|
commands:
|
||||||
|
- composer install
|
||||||
|
- name: build
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- composer build
|
||||||
|
- name: lint
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- composer lint
|
||||||
|
# - name: test
|
||||||
|
# image: node
|
||||||
|
# commands:
|
||||||
|
# - composer test
|
||||||
|
# - name: publish package
|
||||||
|
# image: node
|
||||||
|
# environment:
|
||||||
|
# NPM_TOKEN:
|
||||||
|
# from_secret: npm_token
|
||||||
|
# commands:
|
||||||
|
# - echo "//registry.npmjs.org/:_authToken=$${NPM_TOKEN}" > ~/.npmrc
|
||||||
|
# - npm publish
|
||||||
|
# when:
|
||||||
|
# event:
|
||||||
|
# - tag
|
||||||
|
# ref:
|
||||||
|
# - refs/tags/v[0-9].[0-9].[0-9]
|
||||||
|
- name: prepare release
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- composer archive
|
||||||
|
- npm install escape-string-regexp --no-save
|
||||||
|
- node -e "console.log(require('escape-string-regexp')('${DRONE_TAG}'))" > TagName.txt
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
- name: prepare release notes
|
||||||
|
image: alpine
|
||||||
|
commands:
|
||||||
|
- export TagName=$$(cat TagName.txt)
|
||||||
|
- export TagHeading="/## \(.* \($${TagName}\|\[$${TagName}\]\)\)\$/"
|
||||||
|
- export HeadingPattern='/## \(.* \(v[0-9.]*\|\[.*\]\)\)/'
|
||||||
|
- cp -f CHANGELOG.md ReleaseNotes.md
|
||||||
|
- sed -i "1,$${TagHeading}{ $${TagHeading}P ; d } ; $${HeadingPattern},\$d" ReleaseNotes.md
|
||||||
|
- cp -f ReleaseNotes.md ReleaseTitle.md
|
||||||
|
- sed -i "2,\$d ; s$${HeadingPattern}\\\\1/" ReleaseTitle.md
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
- name: publish release
|
||||||
|
image: plugins/github-release
|
||||||
|
commands: []
|
||||||
|
settings:
|
||||||
|
api_key:
|
||||||
|
from_secret: github_publish_token
|
||||||
|
files:
|
||||||
|
- "*.tar"
|
||||||
|
title: ReleaseTitle.md
|
||||||
|
note: ReleaseNotes.md
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
ref:
|
||||||
|
- refs/heads/**
|
||||||
|
- refs/pull/**
|
||||||
|
- refs/tags/**
|
||||||
|
event:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
- tag
|
Loading…
Reference in a new issue