Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
35 changes: 35 additions & 0 deletions .github/workflows/reusable-sdk-npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: npm publish SDK
description: reusable npm workflow for this project

on:
workflow_call:
inputs:
dry-run:
description: 'Run in dry-run mode (the package will not be published)'
default: false
type: boolean
version:
description: 'Version to publish (leave empty to use package.json version)'
default: ''
type: string
tag:
description: 'npm publish tag (e.g., latest, nightly)'
default: ''
type: string
secrets:
npm-token:
description: 'NPM auth token (required unless `dry-run: true`)'
required: false

jobs:
publish-npm:
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/[email protected]
with:
scope: '@iexec/web3telegram'
tag: ${{ inputs.tag }}
version: ${{ inputs.version }}
environment: ${{ (inputs.dry-run && '') || inputs.tag }}
provenance: ${{ !inputs.dry-run }}
dry-run: ${{ inputs.dry-run }}
secrets:
npm-token: ${{ secrets.npm-token }}
6 changes: 4 additions & 2 deletions .github/workflows/sdk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,7 @@ jobs:
- name: Build
run: npm run build

- name: publish dry-run
run: npm publish --dry-run
npm-publish-dry-run:
uses: ./.github/workflows/reusable-sdk-npm.yml
with:
dry-run: true
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,10 @@ jobs:
publish-npm:
# Run only on main branch
if: github.ref == 'refs/heads/main'
uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@publish-npm-v1.5.0
uses: ./.github/workflows/reusable-sdk-npm.yml
needs: set-publish-version
with:
scope: '@iexec/web3telegram'
registry: 'https://registry.npmjs.org'
node-version: '18'
environment: ${{ github.event.inputs.target }}
tag: ${{ github.event.inputs.tag }}
version: ${{ needs.set-publish-version.outputs.VERSION }}
install-command: |
npm ci
secrets:
npm-token: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/sdk-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
publish-npm:
uses: ./.github/workflows/publish-npm-sdk.yml
uses: ./.github/workflows/reusable-sdk-npm.yml
with:
tag: 'latest'
secrets:
Expand Down