Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 0 additions & 166 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1206,172 +1206,6 @@ steps:
- protected-data-delivery-dapp-deploy-prod
- protected-data-delivery-dapp-deploy-staging

---
kind: pipeline
type: docker
name: sdk publish npm

trigger:
event:
- promote
target:
# publish the package @iexec/dataprotector on npm with the tag beta (require sdk version to be [version]-beta.[b])
- sdk-publish-beta
# publish the package @iexec/dataprotector on npm with the tag latest
- sdk-publish-latest
branch:
- main

steps:
- name: install
image: node:18.19
pull: always
commands:
- node -v
- npm -v
- cd packages/sdk
- npm ci
- npm run codegen

- name: build
image: node:18.19
commands:
- cd packages/sdk
- npm run build
depends_on:
- install

- name: check-beta-version
image: node:18.19
commands:
- cd packages/sdk
- npm pkg get version | grep "-beta."
when:
branch:
- main
target:
- sdk-publish-beta

- name: npm-publish-beta
image: plugins/npm
settings:
username:
from_secret: npm_username
token:
from_secret: npm_token
tag: beta
access: public
folder: packages/sdk
depends_on:
- build
- check-beta-version
when:
branch:
- main
target:
- sdk-publish-beta

- name: npm-publish-latest
image: plugins/npm
settings:
username:
from_secret: npm_username
token:
from_secret: npm_token
tag: latest
access: public
folder: packages/sdk
depends_on:
- build
when:
branch:
- main
target:
- sdk-publish-latest

- name: npm-authenticate
image: robertstettner/drone-npm-auth
settings:
username:
from_secret: npm_username
token:
from_secret: npm_token
when:
branch:
- main
target:
- sdk-publish-beta
depends_on:
- npm-publish-beta

- name: npm-retag-latest
image: node:18.19
commands:
- npm dist-tag add @iexec/dataprotector@$(cd packages/sdk/ && npm pkg get version | sed 's/"//g') latest
when:
branch:
- main
target:
- sdk-publish-beta
depends_on:
- npm-authenticate

---
kind: pipeline
type: docker
name: sdk deprecate npm version

trigger:
event:
- promote
target:
# deprecates a version of @iexec/dataprotector
- sdk-deprecate-package

steps:
- name: authenticate
image: robertstettner/drone-npm-auth
settings:
username:
from_secret: npm_username
token:
from_secret: npm_token

- name: deprecate package
image: node:18.19
params:
- PACKAGE_VERSION
commands:
- if [ -n "$PACKAGE_VERSION" ]; then npm deprecate @iexec/dataprotector@$PACKAGE_VERSION "deprecate $PACKAGE_VERSION"; else echo "PACKAGE_VERSION is not set"; fi

---
kind: pipeline
type: docker
name: sdk undeprecate npm version

trigger:
event:
- promote
target:
# remove the deprecation of a version of @iexec/dataprotector
- sdk-undeprecate-package

steps:
- name: authenticate
image: robertstettner/drone-npm-auth
settings:
username:
from_secret: npm_username
token:
from_secret: npm_token

- name: undeprecate package
image: node:18.19
params:
- PACKAGE_VERSION
commands:
- if [ -n "$PACKAGE_VERSION" ]; then npm deprecate @iexec/dataprotector@$PACKAGE_VERSION ""; else echo "PACKAGE_VERSION is not set"; fi

---
kind: pipeline
type: docker
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/publish-npm-sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish Package NPM

on:
workflow_dispatch:
inputs:
target:
description: 'Select deployment target'
required: true
default: staging
type: choice
options:
- staging
- prod

jobs:
publish-npm:
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
with:
scope: '@iexec/dataprotector-sdk'
registry: 'https://registry.npmjs.org'
node-version: '18'
environment: ${{ github.event.inputs.target }}
secrets:
npm-token: ${{ secrets.NPM_TOKEN }}