Nightly #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.9.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@692973e3d937129bcbf40652eb9f2f61becf3332 # 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Select NodeJS version | |
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Select NodeJS version | |
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # 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@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # 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 kitten-analysts:release | |
yarn kitten-engineers:release | |
yarn kitten-scientists:release | |
- name: Generate GitHub release | |
uses: oliversalzburg/action-automatic-semantic-releases@fed219c196922f5a95d2b168b10c43bbd9644763 # v0.0.19 | |
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-* | |
prerelease: true | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
title: Nightly Build v${{ needs.versions.outputs.RELEASE_VERSION }} | |
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 |