-
Notifications
You must be signed in to change notification settings - Fork 35
38 lines (34 loc) · 1.13 KB
/
npm_publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# This workflow will run tests using node and then publish a package when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: Publish Package
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
release:
types: [published]
jobs:
publish-npm:
environment: release
runs-on: ubuntu-latest
env:
VERSION: ${{ inputs.version == '' && github.ref_name || inputs.version }}
NODE-VERSION: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE-VERSION }}
registry-url: https://registry.npmjs.org/
- name: Update version in package.json
run: |
sed -i 's/"version":.*$/"version": "${{ env.VERSION }}",/g' package.json
- name: Build and publish to npm
run: yarn install --frozen-lockfile
- name: Upload artifacts
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ADYEN_REACT_NATIVE_TOKEN }}
CI: true