Skip to content

chore: update tools version number #10

chore: update tools version number

chore: update tools version number #10

name: nightly-release
on:
push:
branches:
- 'nightly-release'
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
release:
needs:
- check_date
- build
- format-and-lint
if: ${{ needs.check_date.outputs.should_run != 'false' }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
# Required by wagoid/commitlint-github-action
fetch-depth: 0
ref: ${{ github.head_ref }}
- 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: Pre Release
run: pnpm run pre-nightly-release
- name: Get the current date time
id: datetime
run: echo "release_date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
author_name: Leonidas
author_email: leonidas@spartan.ng
message: 'nightly release ${{steps.datetime.outputs.release_date}} ⚡'
push: 'origin nightly-release'
- name: Release
run: pnpm run release