mantra/.drone.yml

80 lines
1.9 KiB
YAML
Raw Permalink Normal View History

2021-05-11 02:21:19 +00:00
name: mantra
kind: pipeline
type: docker
steps:
- name: install
image: manuth/silverstripe-dev
commands:
- composer install
- name: build
2021-05-11 11:11:33 +00:00
image: manuth/silverstripe-dev
2021-05-11 02:21:19 +00:00
commands:
- composer build
- name: lint
2021-05-11 11:11:33 +00:00
image: manuth/silverstripe-dev
2021-05-11 02:21:19 +00:00
commands:
- composer lint
# - name: test
2021-05-11 11:11:33 +00:00
# image: manuth/silverstripe-dev
2021-05-11 02:21:19 +00:00
# commands:
# - composer test
# - name: publish package
2021-05-11 11:11:33 +00:00
# image: manuth/silverstripe-dev
2021-05-11 02:21:19 +00:00
# environment:
# NPM_TOKEN:
# from_secret: npm_token
# commands:
# - echo "//registry.npmjs.org/:_authToken=$${NPM_TOKEN}" > ~/.npmrc
# - npm publish
# when:
# event:
# - tag
# ref:
2021-05-11 17:14:28 +00:00
# - refs/tags/v[0-9]*.[0-9]*.[0-9]*
2021-05-11 02:21:19 +00:00
- name: prepare release
2021-05-11 11:11:33 +00:00
image: manuth/silverstripe-dev
2021-05-11 02:21:19 +00:00
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