Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

NPM Publish Nightly #696

NPM Publish Nightly

NPM Publish Nightly #696

name: NPM Publish Nightly
on:
workflow_dispatch:
schedule:
# Every day at 12
- cron: '0 12 * * *'
jobs:
version:
if: github.repository == 'facebookresearch/playtorch'
runs-on: ubuntu-latest
steps:
- id: calculate
name: Set env
run: |
export NIGHTLY_VERSION=$(echo "0.0.0-$(date +%m%d%Y-%H%M)-${GITHUB_SHA::9}")
echo "::set-output name=nightly_version::${NIGHTLY_VERSION}"
outputs:
nightly_version: ${{ steps.calculate.outputs.nightly_version }}
publish-npm-core:
runs-on: ubuntu-latest
needs: [version]
defaults:
run:
working-directory: ./react-native-pytorch-core
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 14
registry-url: https://registry.npmjs.org/
- name: Update package.json version to "${{ needs.version.outputs.nightly_version }}"
run: npm version ${{ needs.version.outputs.nightly_version }}
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Publish To NPM
run: npm publish --tag nightly
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}