From 223fbb6da60eec233a772aa8fac76532d2e1cfcf Mon Sep 17 00:00:00 2001 From: Daryl Ronningen Date: Sat, 7 Aug 2021 16:27:41 -0700 Subject: [PATCH] ci: migrate jenkins to drone --- .drone.yml | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 519c205..0865467 100644 --- a/.drone.yml +++ b/.drone.yml @@ -3,8 +3,55 @@ type: docker name: default steps: - - name: greeting + - name: install image: node:14 commands: - - echo hello - - echo world + - echo ===== INSTALLING DEPENDENCIES ===== + - yarn install + + - name: build + image: node:14 + commands: + - echo ===== BUILDING APPLICATION ===== + - yarn build + + - name: publish + image: node:14 + commands: + - echo ===== PUBLISHING APPLICATION ===== + - echo "//registry.npmjs.org/:_authToken=$${NPM_TOKEN}" > ~/.npmrc + - yarn version $${(node -pe \'require("./package.json").version\')}-$${(git rev-parse HEAD)}.$${(date +%s)} + - npm publish --tag dev --access public + environment: + GITEA_URL: "https://code.relms.dev/NeonJS/library" + GITEA_TOKEN: + from_secret: GITEA_TOKEN + NPM_TOKEN: + from_secret: GITEA_TOKEN + GIT_AUTHOR_NAME: "DroneCI" + GIT_AUTHOR_EMAIL: "drone@relms.dev" + GIT_COMMITTER_NAME: "DroneCI" + GIT_COMMITTER_EMAIL: "drone@relms.dev" + when: + branch: + - master + - refactor/rewrite + + - name: publish + image: node:14 + commands: + - echo ===== PUBLISHING APPLICATION ===== + - yarn semantic-release + environment: + GITEA_URL: "https://code.relms.dev/NeonJS/library" + GITEA_TOKEN: + from_secret: GITEA_TOKEN + NPM_TOKEN: + from_secret: GITEA_TOKEN + GIT_AUTHOR_NAME: "DroneCI" + GIT_AUTHOR_EMAIL: "drone@relms.dev" + GIT_COMMITTER_NAME: "DroneCI" + GIT_COMMITTER_EMAIL: "drone@relms.dev" + when: + branch: + - stable