Skip to content

Nightly

Nightly #138

Workflow file for this run

name: Nightly
on:
schedule:
- cron: "30 2 * * *"
workflow_dispatch:
concurrency:
group: nightly
cancel-in-progress: true
env:
DEV_BUILD: false
KS_RELEASE_CHANNEL: nightly
NIGHTLY_BUILD: true
# renovate: datasource=node-version depName=node versioning=node
NODE_VERSION: "22.12.0"
jobs:
check_date:
runs-on: ubuntu-24.04
name: Check latest commit
outputs:
should_run: ${{ steps.should_run.outputs.should_run }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- 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 "name=should_run::false" >> $GITHUB_OUTPUT
versions:
name: Versions
needs:
- check_date
outputs:
RELEASE_VERSION: ${{ env.RELEASE_VERSION }}
permissions:
contents: read
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Select NodeJS version
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
# We track the release version through KS only.
- name: Determine versions
run: |
cd packages/kitten-scientists
echo "RELEASE_VERSION=$(node ../../scripts/release-version.cjs)" >> $GITHUB_ENV
qa:
name: 🔹 QA
needs:
- check_date
uses: ./.github/workflows/qa.yml
nightly:
name: Nightly
needs:
- check_date
- qa
- versions
if: ${{ needs.check_date.outputs.should_run != 'false' }}
permissions:
actions: write
attestations: write
contents: write
id-token: write
packages: write
pull-requests: read
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: Select NodeJS version
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org
- name: Enable Corepack
run: |
corepack enable
yarn config set enableGlobalCache false
- name: Load cached dependencies
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4
with:
path: .yarn/cache
key: ${{ runner.os }}-node${{ env.NODE_VERSION }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-node${{ env.NODE_VERSION }}
- name: Install dependencies
run: yarn install
- name: Build release
env:
RELEASE_VERSION: ${{ needs.versions.outputs.RELEASE_VERSION }}
run: |
yarn build:all
yarn ka:release
yarn ke:release
yarn ks:release
- name: Generate GitHub release
uses: oliversalzburg/action-automatic-semantic-releases@84c9be82eea35aab4a98d4c09dd62168fe3d22bc # v0.3.2
with:
automatic_release_tag: nightly
draft: false
files: |
packages/kitten-analysts/output/kitten-analysts-*
packages/kitten-engineers/output/kitten-engineers-*
packages/kitten-scientists/output/kitten-scientists-*
merge_similar: true
prerelease: true
repo_token: ${{ secrets.GITHUB_TOKEN }}
title: Nightly Build v${{ needs.versions.outputs.RELEASE_VERSION }}
with_authors: false
update-release-info:
name: 🔹 Update Release Info
if: success() && !inputs.dry-run
needs:
- nightly
permissions:
contents: read
id-token: write
uses: ./.github/workflows/release-info.yml
publish-devcontainer:
name: 🔹 Publish Devcontainer
needs:
- qa
- versions
permissions:
attestations: write
contents: read
id-token: write
packages: write
pages: write
pull-requests: read
security-events: write
uses: oliversalzburg/workflows/.github/workflows/publish-oci.yml@main
with:
artifact-name: devcontainer-output
containerfile: packages/devcontainer/Containerfile
image-description: Kitten Science Development Container
image-name: kitten-science/devcontainer
image-tag: nightly
image-title: devcontainer
is-latest: false
push: true
with-sarif: false
publish-ka-backend:
name: 🔹 Publish Backend
needs:
- qa
- versions
permissions:
attestations: write
contents: read
id-token: write
packages: write
pages: write
pull-requests: read
security-events: write
uses: oliversalzburg/workflows/.github/workflows/publish-oci.yml@main
with:
artifact-name: ka-backend-output
containerfile: packages/kitten-analysts/backend.Containerfile
image-description: Kitten Science Analytics Backend
image-name: kitten-science/ka-backend
image-tag: nightly
image-title: ka-backend
is-latest: false
push: true
publish-ka-game:
name: 🔹 Publish Game
needs:
- qa
- versions
permissions:
attestations: write
contents: read
id-token: write
packages: write
pages: write
pull-requests: read
security-events: write
uses: oliversalzburg/workflows/.github/workflows/publish-oci.yml@main
with:
artifact-name: ka-game-output
containerfile: packages/kitten-analysts/game.Containerfile
image-description: Kittens Game with Kitten Science Analytics
image-name: kitten-science/ka-game
image-tag: nightly
image-title: ka-game
is-latest: false
push: true
publish-ka-ui:
name: 🔹 Publish UI
needs:
- qa
- versions
permissions:
attestations: write
contents: read
id-token: write
packages: write
pages: write
pull-requests: read
security-events: write
uses: oliversalzburg/workflows/.github/workflows/publish-oci.yml@main
with:
artifact-name: ka-ui-output
containerfile: packages/kitten-analysts/ui.Containerfile
image-description: Headless Kittens Game
image-name: kitten-science/ka-ui
image-tag: nightly
image-title: ka-ui
is-latest: false
push: true