-
Notifications
You must be signed in to change notification settings - Fork 46
67 lines (60 loc) · 1.99 KB
/
publish-react-native.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Publish React Native Plugin
on:
workflow_call:
inputs:
repository:
description: 'sdk repository, defaults to current repository'
required: false
type: string
ref:
description: 'commit/tag/branch reference'
required: true
type: string
package-version:
description: 'version for the npm package (MAJOR.MINOR.BUILD)'
required: true
type: string
publish:
description: 'value indicating whether to publish to npm.'
required: true
type: boolean
default: false
secrets:
NPM_TOKEN:
description: 'access token for npm publish'
required: true
jobs:
build-package:
runs-on: ubuntu-latest
steps:
- name: Checkout breez-sdk repo
uses: actions/checkout@v4
with:
repository: ${{ inputs.repository || github.repository }}
ref: ${{ inputs.ref || github.sha }}
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
scope: '@breeztech'
- name: Make sure we publish the version as specified
working-directory: libs/sdk-react-native
run: npm --no-git-tag-version --allow-same-version version ${{ inputs.package-version || '0.0.2' }}
- name: Install dependencies
working-directory: libs/sdk-react-native
run: yarn
- name: Pack for archival
working-directory: libs/sdk-react-native
run: yarn pack --filename sdk-react-native.tgz
- name: Archive the package
uses: actions/upload-artifact@v4
with:
name: react-native-${{ inputs.package-version || '0.0.2' }}
path: libs/sdk-react-native/sdk-react-native.tgz
- name: Publish package to npm
if: ${{ inputs.publish }}
working-directory: libs/sdk-react-native
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn publish