-
Notifications
You must be signed in to change notification settings - Fork 15
238 lines (216 loc) · 6.54 KB
/
nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
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