74 lines
1.8 KiB
YAML
74 lines
1.8 KiB
YAML
|
kind: pipeline
|
||
|
type: docker
|
||
|
name: default
|
||
|
|
||
|
steps:
|
||
|
- name: install
|
||
|
image: node:16
|
||
|
commands:
|
||
|
- echo ===== INSTALLING DEPENDENCIES =====
|
||
|
- yarn install
|
||
|
|
||
|
- name: build
|
||
|
image: node:16
|
||
|
commands:
|
||
|
- echo ===== BUILDING APPLICATION =====
|
||
|
- yarn build
|
||
|
|
||
|
- name: publish-dev
|
||
|
image: node:16
|
||
|
commands:
|
||
|
- echo ===== PUBLISHING APPLICATION =====
|
||
|
- echo "//registry.npmjs.org/:_authToken=$${NPM_TOKEN}" > ~/.npmrc
|
||
|
- apt update
|
||
|
- apt install -y jq
|
||
|
- npm version --git-tag-version=false $$(jq --raw-output '.version' package.json)-$$(git rev-parse HEAD).$$(date +%s)
|
||
|
- npm publish --tag dev --access public
|
||
|
environment:
|
||
|
NPM_TOKEN:
|
||
|
from_secret: NPM_TOKEN
|
||
|
when:
|
||
|
branch:
|
||
|
- master
|
||
|
event:
|
||
|
- push
|
||
|
|
||
|
- name: publish-stable
|
||
|
image: node:16
|
||
|
commands:
|
||
|
- echo ===== PUBLISHING APPLICATION =====
|
||
|
- yarn semantic-release
|
||
|
environment:
|
||
|
GITEA_URL: "https://code.relms.dev"
|
||
|
GITEA_TOKEN:
|
||
|
from_secret: GITEA_TOKEN
|
||
|
NPM_TOKEN:
|
||
|
from_secret: NPM_TOKEN
|
||
|
GIT_AUTHOR_NAME: "DroneCI"
|
||
|
GIT_AUTHOR_EMAIL: "drone@relms.dev"
|
||
|
GIT_COMMITTER_NAME: "DroneCI"
|
||
|
GIT_COMMITTER_EMAIL: "drone@relms.dev"
|
||
|
when:
|
||
|
branch:
|
||
|
- stable
|
||
|
event:
|
||
|
- push
|
||
|
|
||
|
# - name: discord-notification
|
||
|
# image: appleboy/drone-discord
|
||
|
# settings:
|
||
|
# webhook_id:
|
||
|
# from_secret: DISCORD_WEBHOOK_ID
|
||
|
# webhook_token:
|
||
|
# from_secret: DISCORD_WEBHOOK_TOKEN
|
||
|
# message: >
|
||
|
# {{#success build.status}}
|
||
|
# Build {{build.number}} succeeded.
|
||
|
# {{else}}
|
||
|
# Build {{build.number}} failed.
|
||
|
# {{/success}}
|
||
|
# when:
|
||
|
# status:
|
||
|
# - success
|
||
|
# - failure
|