Publish Nightly #738
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Nightly | |
on: | |
# https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule | |
# Note: this will set GITHUB_SHA to the latest commit on the default branch. | |
schedule: | |
# 2AM EST == 6AM UTC | |
- cron: '0 6 * * *' | |
jobs: | |
check_date: | |
runs-on: ubuntu-22.04 | |
name: Check latest commit | |
outputs: | |
should_run: ${{ steps.should_run.outputs.should_run }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: print latest_commit | |
run: echo ${{ github.sha }} | |
- id: should_run | |
continue-on-error: true | |
name: check latest commit is less than a day | |
if: ${{ github.event_name == 'schedule' }} | |
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "should_run=false" >> $GITHUB_OUTPUT | |
publish-nightly: | |
needs: check_date | |
if: ${{ needs.check_date.outputs.should_run != 'false' }} | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: '0' # Need the history to properly select the canary version number | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.nvmrc' | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- run: npm run build | |
# Need the --no-verify-access access flag since we use an automation token. Otherwise publish step fails | |
# https://github.com/lerna/lerna/issues/2788 | |
- run: ./node_modules/.bin/lerna publish --no-verify-access --canary --force-publish=\* --preid beta --dist-tag nightly --yes | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.DEEPHAVENBOT_NPM_TOKEN }} |