Publish npm packages from Action

Summary: Adds an action for publishing packages to npm. Secret was added as part of T80403944.

Reviewed By: nikoant

Differential Revision: D25195740

fbshipit-source-id: 51d43d9f5e84a25a67b637233b2c62a9a1a15063
This commit is contained in:
Pascal Hartig
2020-11-27 09:28:48 -08:00
committed by Facebook GitHub Bot
parent b5e613141e
commit 30628c8139
2 changed files with 36 additions and 1 deletions

28
.github/workflows/publish-npm.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Publish NPM
on:
push:
tags:
- v*
workflow_dispatch:
defaults:
run:
working-directory: desktop/
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install
run: yarn
- name: Set up npm token
run: echo "//registry.yarnpkg.com/:_authToken=${{ secrets.FLIPPER_NPM_TOKEN }}" >> ~/.npmrc
- name: Publish packages
run: yarn publish-packages
- name: Publish React Native
run: yarn publish
working-directory: react-native/react-native-flipper

View File

@@ -181,10 +181,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Workflow Dispatch
- name: Publish Workflow Dispatch
if: ${{ needs.release.outputs.tag != '' }}
uses: benc-uk/workflow-dispatch@v1.1
with:
workflow: Publish Pods
token: ${{ secrets.PERSONAL_TOKEN }}
ref: ${{ needs.release.outputs.tag }}
- name: Publish NPM
if: ${{ needs.release.outputs.tag != '' }}
uses: benc-uk/workflow-dispatch@v1.1
with:
workflow: Publish NPM
token: ${{ secrets.PERSONAL_TOKEN }}
ref: ${{ needs.release.outputs.tag }}