-
Notifications
You must be signed in to change notification settings - Fork 31
46 lines (45 loc) · 1.68 KB
/
publish-nightly.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
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 }}