mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-01-12 17:42:24 +08:00
49 lines
1.6 KiB
YAML
49 lines
1.6 KiB
YAML
name: Publish
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
publish_npm:
|
|
if: "(github.event_name == 'workflow_displatch') || ((github.event_name == 'push') && contains(toJSON(github.event.commits.*.message), '[publish]'))"
|
|
name: 'NPM'
|
|
timeout-minutes: 5
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
ref: 'master'
|
|
fetch-depth: 0
|
|
- name: Yarn Install
|
|
run: yarn --no-audit --prefer-offline
|
|
- name: GIT Setup
|
|
run: |
|
|
git config --global user.name '@Salakar'
|
|
git config --global user.email 'Salakar@users.noreply.github.com'
|
|
git remote set-url origin git@github.com:$GITHUB_REPOSITORY
|
|
- uses: webfactory/ssh-agent@v0.2.0
|
|
with:
|
|
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
- name: Publish Packages
|
|
run: |
|
|
yarn logout
|
|
echo "@react-native-firebase:registry=http://registry.npmjs.org/" > ~/.npmrc
|
|
echo "registry=http://registry.npmjs.org/" >> ~/.npmrc
|
|
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
|
npm whoami
|
|
git diff --exit-code
|
|
yarn lerna version --yes
|
|
yarn lerna publish from-package --yes
|
|
env:
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
- name: Deploy Documentation
|
|
env:
|
|
NETLIFY_TRIGGER_URL: ${{ secrets.NETLIFY_TRIGGER_URL }}
|
|
run: |
|
|
curl -X POST -d {} "$NETLIFY_TRIGGER_URL"
|