Skip to content

chore: try on push for testing #2

chore: try on push for testing

chore: try on push for testing #2

name: nightly-release
on:
push:
branches:
- "feat/nightly-builds"
jobs:
check_date:
runs-on: ubuntu-latest
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@v2
- 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 "::set-output name=should_run::false"
commitlint:
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
# Required by wagoid/commitlint-github-action
pull-requests: read
steps:
- uses: actions/checkout@v4
with:
# Required by wagoid/commitlint-github-action
fetch-depth: 0
- name: Install Node v22
uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Install pnpm globally
run: npm install -g pnpm
- name: Lint commit messages
uses: wagoid/commitlint-github-action@v5
with:
failOnWarnings: true
helpURL: https://github.com/goetzrobin/spartan/blob/main/CONTRIBUTING.md#-commit-message-guidelines
format-and-lint:
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Required by wagoid/commitlint-github-action
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Install PNPM globally
run: npm install -g pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: lint
run: pnpm run lint
- name: format
run: pnpm nx format:check --base=origin/main
build:
needs: check_date
if: ${{ needs.check_date.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Required by wagoid/commitlint-github-action
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Install PNPM globally
run: npm install -g pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: pnpm run build
publish:
needs:
- check_date
- build
if: ${{ needs.check_date.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Required by wagoid/commitlint-github-action
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- name: Install PNPM globally
run: npm install -g pnpm
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Release
run: pnpm run pre-nightly-release && pnpm run release