-
Notifications
You must be signed in to change notification settings - Fork 2.2k
49 lines (47 loc) · 1.61 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
name: Publish
on:
workflow_dispatch:
push:
branches:
- main
jobs:
publish_npm:
if: "(github.repository == 'invertase/react-native-firebase') && (github.event_name == 'workflow_dispatch')"
name: 'NPM'
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: 'main'
fetch-depth: 0
# Repository admin required to evade PR+checks branch protection
token: ${{ secrets.GH_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Yarn Install
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
retry_wait_seconds: 60
max_attempts: 3
command: yarn && yarn lerna:prepare
- name: GIT Setup
# Alter branding of release commit, despite GITHUB_TOKEN having real owner
run: |
git config --global user.name 'Invertase Publisher'
git config --global user.email '[email protected]'
- name: Publish Packages
# for lerna, you must write the token out to .npmrc like this
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
git diff --exit-code
yarn lerna changed
yarn lerna version --yes --force-publish=*
yarn lerna publish from-package --yes
env:
# new style token w/scope for `@react-native-firebase` required
# to work with npmjs.com 2FA-or-automation-token package requirement
NPM_TOKEN: ${{ secrets.MIKEHARDY_NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}