Skip to content

Commit af78bf8

Browse files
ci(deserializer): add GHA for NPM publishing (#420)
1 parent dbe426d commit af78bf8

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

.drone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,4 +1283,4 @@ steps:
12831283
branch:
12841284
- main
12851285
target:
1286-
- dataprotector-deserializer-publish-latest
1286+
- dataprotector-deserializer-publish-latest
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
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
14+
15+
jobs:
16+
set-env:
17+
runs-on: ubuntu-latest
18+
outputs:
19+
resolved-environment: ${{ steps.setenv.outputs.env }}
20+
steps:
21+
- id: setenv
22+
run: |
23+
if [ "${{ github.event.inputs.tag }}" = "latest" ]; then
24+
echo "env=production" >> $GITHUB_OUTPUT
25+
else
26+
echo "env=staging" >> $GITHUB_OUTPUT
27+
fi
28+
29+
publish-npm:
30+
needs: set-env
31+
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
32+
with:
33+
scope: '@iexec/deserializer'
34+
registry: 'https://registry.npmjs.org'
35+
node-version: '18'
36+
environment: ${{ needs.set-env.outputs.resolved-environment }}
37+
working-directory: "packages/dataprotector-deserializer"
38+
secrets:
39+
npm-token: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)