Skip to content

Commit 20eb987

Browse files
keep drone
1 parent eb462e7 commit 20eb987

File tree

1 file changed

+196
-0
lines changed

1 file changed

+196
-0
lines changed

.drone.yml

Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,202 @@ steps:
979979
- protected-data-delivery-dapp-deploy-prod
980980
- protected-data-delivery-dapp-deploy-staging
981981

982+
---
983+
kind: pipeline
984+
type: docker
985+
name: sdk publish npm
986+
987+
trigger:
988+
event:
989+
- promote
990+
target:
991+
# publish the package @iexec/dataprotector on npm with the tag nightly
992+
- sdk-publish-nightly
993+
# publish the package @iexec/dataprotector on npm with the tag beta (require sdk version to be [version]-beta.[b])
994+
- sdk-publish-beta
995+
# publish the package @iexec/dataprotector on npm with the tag latest
996+
- sdk-publish-latest
997+
branch:
998+
- main
999+
1000+
steps:
1001+
- name: install
1002+
image: node:18.19
1003+
pull: always
1004+
commands:
1005+
- node -v
1006+
- npm -v
1007+
- cd packages/sdk
1008+
- npm ci
1009+
- npm run codegen
1010+
1011+
- name: build
1012+
image: node:18.19
1013+
commands:
1014+
- cd packages/sdk
1015+
- npm run build
1016+
depends_on:
1017+
- install
1018+
1019+
- name: check-beta-version
1020+
image: node:18.19
1021+
commands:
1022+
- cd packages/sdk
1023+
- npm pkg get version | grep "-beta."
1024+
when:
1025+
branch:
1026+
- main
1027+
target:
1028+
- sdk-publish-beta
1029+
1030+
- name: set-version-nightly
1031+
image: node:18.19
1032+
commands:
1033+
- cd packages/sdk
1034+
- eval npm pkg set version="$(npm pkg get version)-nightly-$DRONE_COMMIT"
1035+
when:
1036+
target:
1037+
- sdk-publish-nightly
1038+
depends_on:
1039+
- install
1040+
1041+
- name: npm publish nightly
1042+
image: plugins/npm
1043+
settings:
1044+
username:
1045+
from_secret: npm_username
1046+
token:
1047+
from_secret: npm_token
1048+
tag: nightly
1049+
access: public
1050+
folder: packages/sdk
1051+
depends_on:
1052+
- build
1053+
- set-version-nightly
1054+
when:
1055+
target:
1056+
- sdk-publish-nightly
1057+
1058+
- name: npm-publish-beta
1059+
image: plugins/npm
1060+
settings:
1061+
username:
1062+
from_secret: npm_username
1063+
token:
1064+
from_secret: npm_token
1065+
tag: beta
1066+
access: public
1067+
folder: packages/sdk
1068+
depends_on:
1069+
- build
1070+
- check-beta-version
1071+
when:
1072+
branch:
1073+
- main
1074+
target:
1075+
- sdk-publish-beta
1076+
1077+
- name: npm-publish-latest
1078+
image: plugins/npm
1079+
settings:
1080+
username:
1081+
from_secret: npm_username
1082+
token:
1083+
from_secret: npm_token
1084+
tag: latest
1085+
access: public
1086+
folder: packages/sdk
1087+
depends_on:
1088+
- build
1089+
when:
1090+
branch:
1091+
- main
1092+
target:
1093+
- sdk-publish-latest
1094+
1095+
- name: npm-authenticate
1096+
image: robertstettner/drone-npm-auth
1097+
settings:
1098+
username:
1099+
from_secret: npm_username
1100+
token:
1101+
from_secret: npm_token
1102+
when:
1103+
branch:
1104+
- main
1105+
target:
1106+
- sdk-publish-beta
1107+
depends_on:
1108+
- npm-publish-beta
1109+
1110+
- name: npm-retag-latest
1111+
image: node:18.19
1112+
commands:
1113+
- npm dist-tag add @iexec/dataprotector@$(cd packages/sdk/ && npm pkg get version | sed 's/"//g') latest
1114+
when:
1115+
branch:
1116+
- main
1117+
target:
1118+
- sdk-publish-beta
1119+
depends_on:
1120+
- npm-authenticate
1121+
1122+
---
1123+
kind: pipeline
1124+
type: docker
1125+
name: sdk deprecate npm version
1126+
1127+
trigger:
1128+
event:
1129+
- promote
1130+
target:
1131+
# deprecates a version of @iexec/dataprotector
1132+
- sdk-deprecate-package
1133+
1134+
steps:
1135+
- name: authenticate
1136+
image: robertstettner/drone-npm-auth
1137+
settings:
1138+
username:
1139+
from_secret: npm_username
1140+
token:
1141+
from_secret: npm_token
1142+
1143+
- name: deprecate package
1144+
image: node:18.19
1145+
params:
1146+
- PACKAGE_VERSION
1147+
commands:
1148+
- if [ -n "$PACKAGE_VERSION" ]; then npm deprecate @iexec/dataprotector@$PACKAGE_VERSION "deprecate $PACKAGE_VERSION"; else echo "PACKAGE_VERSION is not set"; fi
1149+
1150+
---
1151+
kind: pipeline
1152+
type: docker
1153+
name: sdk undeprecate npm version
1154+
1155+
trigger:
1156+
event:
1157+
- promote
1158+
target:
1159+
# remove the deprecation of a version of @iexec/dataprotector
1160+
- sdk-undeprecate-package
1161+
1162+
steps:
1163+
- name: authenticate
1164+
image: robertstettner/drone-npm-auth
1165+
settings:
1166+
username:
1167+
from_secret: npm_username
1168+
token:
1169+
from_secret: npm_token
1170+
1171+
- name: undeprecate package
1172+
image: node:18.19
1173+
params:
1174+
- PACKAGE_VERSION
1175+
commands:
1176+
- if [ -n "$PACKAGE_VERSION" ]; then npm deprecate @iexec/dataprotector@$PACKAGE_VERSION ""; else echo "PACKAGE_VERSION is not set"; fi
1177+
9821178
---
9831179
kind: pipeline
9841180
type: docker

0 commit comments

Comments
 (0)