Skip to content

Daily Build

Daily Build #678

Workflow file for this run

name: Daily Build
on:
schedule:
# The format of cron is 'Minutes' 'Hours' 'Days' 'Months' 'Days of Week'
# The time zone is UTC.
- cron: "0 22 * * *"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
strategy:
# Set 1 to run 16.x job before other jobs.
max-parallel: 1
# Set false not to cancel all jobs when one of the jobs failed.
fail-fast: false
matrix:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
# We should execute 20.x first. Because only 20.x job updates package.json if necessary.
node-version: [20.x]
branch: [main]
steps:
- name: Checkout to ${{ matrix.branch }}
uses: actions/checkout@v4
with:
ref: ${{ matrix.branch }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Configure git
run: |
git config --global user.name "github actions"
git config --global user.email "um7a@users.noreply.github.com"
- name: Update npm packages
if: ${{ matrix.node-version == '20.x' }}
run: |
cp package.json package.json.old
npm install -g npm-package-updater
npm-package-updater --caret --git --commit-prefix "deps: " --debug --conservative
- name: Install npm packages
run: npm install
- name: Commit package-lock.json
run: |
if [[ ! -z $(diff package.json.old package.json) ]]; then
git add package-lock.json
git commit -m "deps: Update package-lock.json"
fi
- name: Check npm package vulnerabilities
run: npm audit --production
- name: Test
run: npm test
- name: Build app for x64
run: npm run build:x64
- name: Build app for arm64
run: npm run build:arm64
- name: Push package.json and package-lock.json if needed
if: ${{ matrix.node-version == '20.x' }}
run: |
if [[ ! -z $(diff package.json.old package.json) ]]; then
git push origin ${{ matrix.branch }}
fi