feat(ci) Setting up drone ci + fix package [test] (#1)
Reviewed-on: #1 Co-authored-by: EndMove <superjeremi1302@gmail.com> Co-committed-by: EndMove <superjeremi1302@gmail.com>
This commit was merged in pull request #1.
This commit is contained in:
60
.drone.yml
60
.drone.yml
@@ -6,6 +6,9 @@ name: npm-publish-snapshot
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
exclude:
|
||||
- master
|
||||
|
||||
steps:
|
||||
- name: publish-snapshot
|
||||
@@ -14,13 +17,54 @@ steps:
|
||||
GITEA_TOKEN:
|
||||
from_secret: gitea_token
|
||||
commands:
|
||||
- VERSION=$(cat VERSION 2>/dev/null) || echo "1.0.0"
|
||||
- SNAPSHOT=${VERSION}-snapshot.${DRONE_BUILD_NUMBER}
|
||||
- echo "Current version=${VERSION}"
|
||||
- echo "Snapshot version=${SNAPSHOT}"
|
||||
- npm config set @ioprojects:registry https://git.endmove.eu/api/packages/io-projectsofficial/npm/
|
||||
- npm config set -- '//git.endmove.eu/api/packages/io-projectsofficial/npm/:_authToken' "${GITEA_TOKEN}"
|
||||
- export VERSION=$(node -p "require('./package.json').version") || echo "1.0.0"
|
||||
- SNAPSHOT="$(echo $VERSION)-snapshot.${DRONE_BUILD_NUMBER}"
|
||||
- echo $VERSION
|
||||
- echo $SNAPSHOT
|
||||
- npm ci
|
||||
- npm version ${SNAPSHOT}
|
||||
- npm version $SNAPSHOT
|
||||
- npm publish --tag snapshot
|
||||
# - npm dist-tag add @ioprojects/eslint-config@$SNAPSHOT snapshot
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: npm-publish-release
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- promote
|
||||
branch:
|
||||
- master
|
||||
|
||||
environement:
|
||||
CHANGE: ${CHANGE}
|
||||
|
||||
steps:
|
||||
- name: publish-release
|
||||
image: node:18
|
||||
environment:
|
||||
GITEA_TOKEN:
|
||||
from_secret: gitea_token
|
||||
CHANGE: ${CHANGE}
|
||||
commands:
|
||||
- git fetch --tags
|
||||
- npm ci
|
||||
- echo $CHANGE
|
||||
- npm version $CHANGE
|
||||
- git push --set-upstream origin `git name-rev --name-only HEAD`
|
||||
- export VERSION=$(node -p "require('./package.json').version") || echo "1.0.0"
|
||||
- echo $VERSION
|
||||
- npm publish
|
||||
- npm dist-tag add @ioprojects/ui-eslint-base@${SNAPSHOT} snapshot
|
||||
- name: gitea-release
|
||||
image: plugins/gitea-release
|
||||
settings:
|
||||
api_key:
|
||||
from_secret: gitea_api_key
|
||||
base_url: https://git.endmove.eu
|
||||
title: Release ${VERSION}
|
||||
notes: 'See the commits diff for more informations'
|
||||
checksum:
|
||||
- md5
|
||||
- sha1
|
||||
- sha256
|
||||
|
||||
Reference in New Issue
Block a user