diff --git a/.drone.yml b/.drone.yml index 0a08d804c..20b7f231f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1283,4 +1283,4 @@ steps: branch: - main target: - - dataprotector-deserializer-publish-latest + - dataprotector-deserializer-publish-latest \ No newline at end of file diff --git a/.github/workflows/publish-npm-deserializer.yml b/.github/workflows/publish-npm-deserializer.yml new file mode 100644 index 000000000..b63d67153 --- /dev/null +++ b/.github/workflows/publish-npm-deserializer.yml @@ -0,0 +1,39 @@ +name: Publish Package NPM + +on: + workflow_dispatch: + inputs: + tag: + description: 'NPM tag to publish (latest or nightly)' + required: true + type: choice + options: + - latest + - nightly + default: nightly + +jobs: + set-env: + runs-on: ubuntu-latest + outputs: + resolved-environment: ${{ steps.setenv.outputs.env }} + steps: + - id: setenv + run: | + if [ "${{ github.event.inputs.tag }}" = "latest" ]; then + echo "env=production" >> $GITHUB_OUTPUT + else + echo "env=staging" >> $GITHUB_OUTPUT + fi + + publish-npm: + needs: set-env + uses: iExecBlockchainComputing/github-actions-workflows/.github/workflows/publish-npm.yml@publish-npm-v1.3.0 + with: + scope: '@iexec/deserializer' + registry: 'https://registry.npmjs.org' + node-version: '18' + environment: ${{ needs.set-env.outputs.resolved-environment }} + working-directory: "packages/dataprotector-deserializer" + secrets: + npm-token: ${{ secrets.NPM_TOKEN }}