-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (54 loc) · 1.77 KB
/
react-native-sdk.workflow.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
name: ReactNative-SDK
on:
push:
branches:
- main
workflow_dispatch:
inputs:
environment:
description: Configuration environment
required: true
default: 'dev'
type: choice
options:
- dev
- rc
- prod
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
cancel-in-progress: true
env:
NODE_VERSION: '20'
RC_SUFFIX: 'rc'
GLOBAL_ENV: ${{ github.event_name == 'push' && format('{0}', 'dev') || inputs.environment }}
jobs:
build-react-native-sdk:
runs-on: macos-14
steps:
- name: Git clone repository
uses: actions/checkout@v4
# Setup Node.js
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
# Publish to npm
- name: Set NPM Packages Config
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
# Git Set Identity
- name: Git Identity
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
# Commit Version Locally for Github npm
- name: Commit Version Locally for Github npm
run: git add .npmrc && git commit -am "Prepare to release"
# Install dependencies
- name: Install dependencies
run: yarn set version 3.6.1 && yarn
# Build and Publish SDK
- name: Build and Publish SDK
if: ${{ env.GLOBAL_ENV == 'prod' || env.GLOBAL_ENV == 'rc' }}
run: npm publish --tag ${{ env.RELEASE_TAG }} --access public --userconfig ./.npmrc
env:
RELEASE_TAG: ${{ env.GLOBAL_ENV == 'prod' && format('{0}', 'latest' ) || env.RC_SUFFIX }}