Skip to content

Commit 5cf2f57

Browse files
committed
ci(deserializer): add GHA for NPM publishing
1 parent b8b70d8 commit 5cf2f57

File tree

2 files changed

+24
-110
lines changed

2 files changed

+24
-110
lines changed

.drone.yml

Lines changed: 0 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,113 +1371,3 @@ steps:
13711371
- PACKAGE_VERSION
13721372
commands:
13731373
- if [ -n "$PACKAGE_VERSION" ]; then npm deprecate @iexec/dataprotector@$PACKAGE_VERSION ""; else echo "PACKAGE_VERSION is not set"; fi
1374-
1375-
---
1376-
kind: pipeline
1377-
type: docker
1378-
name: dataprotector-deserializer publish npm
1379-
1380-
trigger:
1381-
event:
1382-
- promote
1383-
target:
1384-
# publish the package @iexec/dataprotector-deserializer on npm with the tag nightly
1385-
- dataprotector-deserializer-publish-nightly
1386-
# publish the package @iexec/dataprotector-deserializer on npm with the tag latest
1387-
- dataprotector-deserializer-publish-latest
1388-
branch:
1389-
- develop
1390-
- main
1391-
1392-
steps:
1393-
- name: build test dependency dataprotector-sdk
1394-
image: node:18
1395-
pull: always
1396-
commands:
1397-
- cd packages/sdk
1398-
- npm ci
1399-
- npm run codegen
1400-
- npm run build
1401-
1402-
- name: install
1403-
image: node:18
1404-
pull: always
1405-
commands:
1406-
- cd packages/dataprotector-deserializer
1407-
- node -v
1408-
- npm -v
1409-
- npm ci
1410-
- npm run test:prepare
1411-
1412-
- name: format
1413-
image: node:18
1414-
commands:
1415-
- cd packages/dataprotector-deserializer
1416-
- npm run check-format
1417-
1418-
- name: lint
1419-
image: node:18
1420-
commands:
1421-
- cd packages/dataprotector-deserializer
1422-
- npm run lint
1423-
1424-
- name: check-types
1425-
image: node:18
1426-
commands:
1427-
- cd packages/dataprotector-deserializer
1428-
- npm run check-types
1429-
1430-
- name: test
1431-
image: node:18
1432-
commands:
1433-
- cd packages/dataprotector-deserializer
1434-
- npm run test
1435-
1436-
- name: build
1437-
image: node:18
1438-
commands:
1439-
- cd packages/dataprotector-deserializer
1440-
- npm run build
1441-
1442-
- name: set nightly version
1443-
image: node:18.19
1444-
commands:
1445-
- cd packages/dataprotector-deserializer
1446-
- eval npm pkg set version="$(npm pkg get version)-nightly-$DRONE_COMMIT"
1447-
when:
1448-
branch:
1449-
- develop
1450-
target:
1451-
- dataprotector-deserializer-publish-nightly
1452-
1453-
- name: npm publish nightly
1454-
image: plugins/npm
1455-
settings:
1456-
username:
1457-
from_secret: npm_username
1458-
token:
1459-
from_secret: npm_token_dataprotector_deserializer
1460-
tag: nightly
1461-
access: public
1462-
folder: packages/dataprotector-deserializer
1463-
when:
1464-
branch:
1465-
- develop
1466-
target:
1467-
- dataprotector-deserializer-publish-nightly
1468-
1469-
- name: npm publish latest
1470-
image: plugins/npm
1471-
settings:
1472-
username:
1473-
from_secret: npm_username
1474-
token:
1475-
from_secret: npm_token_dataprotector_deserializer
1476-
tag: latest
1477-
access: public
1478-
folder: packages/dataprotector-deserializer
1479-
when:
1480-
branch:
1481-
- main
1482-
target:
1483-
- dataprotector-deserializer-publish-latest
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish Package NPM
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: 'NPM tag to publish (latest or nightly)'
8+
required: true
9+
type: choice
10+
options:
11+
- latest
12+
- nightly
13+
default: nightly # Check this with the team
14+
15+
jobs:
16+
publish-npm:
17+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
18+
with:
19+
scope: '@iexec/deserializer'
20+
registry: 'https://registry.npmjs.org'
21+
node-version: '18'
22+
environment: ${{ inputs.tag == 'latest' ? 'production' : 'staging' }}
23+
secrets:
24+
npm-token: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)