From 91c1221cef63b82e134949c7ff14b99653897602 Mon Sep 17 00:00:00 2001 From: Elizabeth Mitchell Date: Wed, 15 Nov 2023 10:36:29 -0800 Subject: [PATCH] fix: add `@material/web@nightly` publishes Adds a workflow that runs daily at 3:21am if there have been new commits in the past 24 hours since the last run. PiperOrigin-RevId: 582728131 --- .github/workflows/nightly.yml | 45 +++++++++++++++++++++++ .github/workflows/update-docs-on-main.yml | 2 +- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000000..4fcfc34562 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,45 @@ +name: Nightly publish + +on: + schedule: + - cron: '21 3 * * *' + workflow_dispatch: + # allows triggering from the github UI + +jobs: + check_for_changes: + runs-on: ubuntu-latest + outputs: + changed: ${{ steps.check.outputs.changed }} + + steps: + - uses: actions/checkout@v3 + - name: Check if the current commit is less than 24 hours old + id: check + run: test -n "$(git rev-list --after='24 hours' ${{ github.sha }})" && echo "changed=yes" >> "$GITHUB_OUTPUT" + + publish: + needs: check_for_changes + if: needs.check_for_changes.outputs.changed == 'yes' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - uses: google/wireit@setup-github-actions-caching/v1 + + - run: npm ci + - run: npm run build + env: + WIREIT_FAILURES: continue + + - uses: actions/setup-node@v3 + with: + node-version: 18 + registry-url: 'https://wombat-dressing-room.appspot.com/' + - run: npm publish --tag nightly + env: + NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }} diff --git a/.github/workflows/update-docs-on-main.yml b/.github/workflows/update-docs-on-main.yml index 0e199e82be..d6e985dc45 100644 --- a/.github/workflows/update-docs-on-main.yml +++ b/.github/workflows/update-docs-on-main.yml @@ -4,7 +4,7 @@ on: push: branches: main workflow_dispatch: - # allows triggering from the gihub UI + # allows triggering from the github UI jobs: check-for-doc-changes: runs-on: ubuntu-latest