Skip to content

Commit

Permalink
fix: auto-fix dependencies before release
Browse files Browse the repository at this point in the history
  • Loading branch information
goetzrobin committed Jan 9, 2025
1 parent 9402dab commit f668879
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/nightly-release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
name: nightly-release

on:
schedule:
- cron: '0 0 * * *'
workflow_run:

jobs:
check_date:
Expand All @@ -19,6 +18,17 @@ jobs:
continue-on-error: true
name: check latest commit is less than a day
if: ${{ github.event_name == 'schedule' }}
# This command checks if there were any commits in the last 24 hours.
# If there were NO recent commits, it sets should_run=false.
# How it works:
# 1. git rev-list gets a list of all commits in last 24h
# (--after="24 hours" means "show commits from 24h ago until now",
# so if it runs at 2pm, it checks commits after 2pm yesterday)
# 2. test -z checks if that list is empty (meaning no recent commits)
# 3. If empty (no commits), it sets GitHub Actions output variable 'should_run' to false
# This output variable can then be used in other workflow steps like:
# if: ${{ steps.your-step-id.outputs.should_run != 'false' }}
# to skip steps when there were no recent commits
run: test -z $(git rev-list --after="24 hours" ${{ github.sha }}) && echo "::set-output name=should_run::false"

commitlint:
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
"lint": "nx run-many --target=lint --parallel",
"pre-manual-release": "pnpm run prepare-manual-release && pnpm run format && nx run tools:lint --fix",
"pre-nightly-release": "pnpm run prepare-nightly-release && pnpm run format && nx run tools:lint --fix",
"prepare-manual-release": "nx g @spartan-ng/tools:replace-ui-version && nx g @spartan-ng/tools:hlm-to-cli-generator && nx g @spartan-ng/tools:replace-cli-version",
"prepare-nightly-release": "nx g @spartan-ng/tools:auto-increment-version && nx g @spartan-ng/tools:hlm-to-cli-generator",
"prepare-manual-release": "nx g @spartan-ng/tools:replace-ui-version && nx run-many --target=lint --parallel --fix && nx g @spartan-ng/tools:hlm-to-cli-generator && nx g @spartan-ng/tools:replace-cli-version",
"prepare-nightly-release": "nx g @spartan-ng/tools:auto-increment-version && nx run-many --target=lint --parallel --fix && nx g @spartan-ng/tools:hlm-to-cli-generator",
"release": "pnpm run release-ui && pnpm run release-cli",
"release-cli": "nx run-many --target=release --projects=tag:scope:cli --parallel=1",
"release-ui": "nx run-many --target=release --projects=tag:scope:core,tag:scope:brain --parallel=1",
Expand Down

0 comments on commit f668879

Please sign in to comment.