Skip to content

Commit 3d3540b

Browse files
committed
test cache
1 parent 4a8349a commit 3d3540b

File tree

1 file changed

+115
-18
lines changed

1 file changed

+115
-18
lines changed

.github/workflows/buildService.yml

Lines changed: 115 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,81 +51,178 @@ jobs:
5151
name: Build S9PK (x86_64)
5252
runs-on: ubuntu-24.04
5353
steps:
54+
- name: Checkout services repository
55+
uses: actions/checkout@v4
56+
with:
57+
submodules: recursive
58+
59+
- name: Cache StartOS SDK
60+
id: sdk-cache
61+
uses: actions/cache@v4
62+
with:
63+
path: |
64+
~/.local/share/startos
65+
~/.cache/startos
66+
~/.local/bin/start-cli
67+
key: ${{ runner.os }}-${{ runner.arch }}-k0gen-sdk-v3-${{ hashFiles('**/manifest.y*ml', '**/Makefile') }}
68+
restore-keys: |
69+
${{ runner.os }}-${{ runner.arch }}-k0gen-sdk-v3-
70+
5471
- name: Prepare StartOS SDK
72+
if: steps.sdk-cache.outputs.cache-hit != 'true'
5573
uses: k0gen/sdk@v3-optimization
5674

75+
- name: Build x86_64 package
76+
id: build
77+
shell: bash
78+
run: |
79+
start-cli init
80+
chmod 600 ~/.startos/developer.key.pem
81+
RUST_LOG=debug RUST_BACKTRACE=1 make x86
82+
PACKAGE_FILE=$(ls *_x86_64.s9pk 2>/dev/null | head -n1)
83+
if [ -z "$PACKAGE_FILE" ]; then
84+
echo "❌ No x86_64 package found!"
85+
ls -la *.s9pk || echo "No .s9pk files found"
86+
exit 1
87+
fi
88+
PACKAGE_ID=$(start-cli s9pk inspect "$PACKAGE_FILE" manifest | jq -r '.id')
89+
echo "package_id=${PACKAGE_ID}" >> $GITHUB_ENV
90+
echo "package_file=${PACKAGE_FILE}" >> $GITHUB_ENV
91+
printf "\n x86_64 SHA256: $(sha256sum "${PACKAGE_FILE}") \n"
92+
name: Build S9PK (x86_64)
93+
runs-on: ubuntu-24.04
94+
steps:
5795
- name: Checkout services repository
5896
uses: actions/checkout@v4
5997
with:
6098
submodules: recursive
6199

100+
- name: Cache StartOS SDK
101+
id: sdk-cache
102+
uses: actions/cache@v4
103+
with:
104+
path: |
105+
~/.cache/startos
106+
~/.local/share/startos
107+
~/.local/bin/start-cli
108+
key: ${{ runner.os }}-${{ runner.arch }}-k0gen-sdk-v3-optimization-${{ hashFiles('**/manifest.y*ml', '**/Makefile') }}
109+
restore-keys: |
110+
${{ runner.os }}-${{ runner.arch }}-k0gen-sdk-v3-optimization-
111+
112+
- name: Prepare StartOS SDK
113+
if: steps.sdk-cache.outputs.cache-hit != 'true'
114+
uses: k0gen/sdk@v3-optimization
115+
62116
- name: Build x86_64 package
63117
id: build
64118
shell: bash
65119
run: |
66120
start-cli init
67121
chmod 600 ~/.startos/developer.key.pem
68122
RUST_LOG=debug RUST_BACKTRACE=1 make x86
69-
70123
PACKAGE_FILE=$(ls *_x86_64.s9pk 2>/dev/null | head -n1)
71124
if [ -z "$PACKAGE_FILE" ]; then
72125
echo "❌ No x86_64 package found!"
73126
ls -la *.s9pk || echo "No .s9pk files found"
74127
exit 1
75128
fi
76-
77129
PACKAGE_ID=$(start-cli s9pk inspect "$PACKAGE_FILE" manifest | jq -r '.id')
78130
echo "package_id=${PACKAGE_ID}" >> $GITHUB_ENV
79131
echo "package_file=${PACKAGE_FILE}" >> $GITHUB_ENV
80132
printf "\n x86_64 SHA256: $(sha256sum "${PACKAGE_FILE}") \n"
81133
82-
- name: Upload x86_64 .s9pk
83-
uses: actions/upload-artifact@v4
84-
with:
85-
name: ${{ env.package_file }}
86-
path: ./${{ env.package_file }}
134+
135+
87136
88137
BuildUniversal:
89138
name: Build S9PK (Universal)
90139
runs-on: ubuntu-24.04
91140
needs: [Build_aarch64, Build_x86_64]
92141
steps:
142+
- name: Checkout services repository
143+
uses: actions/checkout@v4
144+
with:
145+
submodules: recursive
146+
147+
- name: Cache StartOS SDK
148+
id: sdk-cache
149+
uses: actions/cache@v4
150+
with:
151+
path: |
152+
~/.local/share/startos
153+
~/.cache/startos
154+
~/.local/bin/start-cli
155+
key: ${{ runner.os }}-${{ runner.arch }}-k0gen-sdk-v3-${{ hashFiles('**/manifest.y*ml', '**/Makefile') }}
156+
restore-keys: |
157+
${{ runner.os }}-${{ runner.arch }}-k0gen-sdk-v3-
158+
93159
- name: Prepare StartOS SDK
160+
if: steps.sdk-cache.outputs.cache-hit != 'true'
94161
uses: k0gen/sdk@v3-optimization
95162

163+
- name: Build Universal package
164+
id: build
165+
shell: bash
166+
run: |
167+
start-cli init
168+
chmod 600 ~/.startos/developer.key.pem
169+
RUST_LOG=debug RUST_BACKTRACE=1 make
170+
PACKAGE_FILE=$(ls *.s9pk 2>/dev/null | grep -Ev '_(aarch64|x86_64)\.s9pk$' | head -n1)
171+
if [ -z "$PACKAGE_FILE" ]; then
172+
PACKAGE_FILE=$(ls *.s9pk 2>/dev/null | head -n1)
173+
fi
174+
if [ -z "$PACKAGE_FILE" ]; then
175+
echo "❌ No universal package found!"
176+
ls -la *.s9pk || echo "No .s9pk files found"
177+
exit 1
178+
fi
179+
PACKAGE_ID=$(start-cli s9pk inspect "$PACKAGE_FILE" manifest | jq -r '.id')
180+
echo "package_id=${PACKAGE_ID}" >> $GITHUB_ENV
181+
echo "package_file=${PACKAGE_FILE}" >> $GITHUB_ENV
182+
printf "\n ⚡ Universal SHA256: $(sha256sum "${PACKAGE_FILE}") \n"
183+
184+
name: Build S9PK (Universal)
185+
runs-on: ubuntu-24.04
186+
needs: [Build_aarch64, Build_x86_64]
187+
steps:
96188
- name: Checkout services repository
97189
uses: actions/checkout@v4
98190
with:
99191
submodules: recursive
100192

193+
- name: Cache StartOS SDK
194+
id: sdk-cache
195+
uses: actions/cache@v4
196+
with:
197+
path: |
198+
~/.cache/startos
199+
~/.local/share/startos
200+
~/.local/bin/start-cli
201+
key: ${{ runner.os }}-${{ runner.arch }}-k0gen-sdk-v3-optimization-${{ hashFiles('**/manifest.y*ml', '**/Makefile') }}
202+
restore-keys: |
203+
${{ runner.os }}-${{ runner.arch }}-k0gen-sdk-v3-optimization-
204+
205+
- name: Prepare StartOS SDK
206+
if: steps.sdk-cache.outputs.cache-hit != 'true'
207+
uses: k0gen/sdk@v3-optimization
208+
101209
- name: Build Universal package
102210
id: build
103211
shell: bash
104212
run: |
105213
start-cli init
106214
chmod 600 ~/.startos/developer.key.pem
107215
RUST_LOG=debug RUST_BACKTRACE=1 make
108-
109-
# Prefer a non-arch-suffixed universal package if present
110216
PACKAGE_FILE=$(ls *.s9pk 2>/dev/null | grep -Ev '_(aarch64|x86_64)\.s9pk$' | head -n1)
111217
if [ -z "$PACKAGE_FILE" ]; then
112-
# Fallback: if packaging already renames to id.s9pk only, just take the first .s9pk
113218
PACKAGE_FILE=$(ls *.s9pk 2>/dev/null | head -n1)
114219
fi
115-
116220
if [ -z "$PACKAGE_FILE" ]; then
117221
echo "❌ No universal package found!"
118222
ls -la *.s9pk || echo "No .s9pk files found"
119223
exit 1
120224
fi
121-
122225
PACKAGE_ID=$(start-cli s9pk inspect "$PACKAGE_FILE" manifest | jq -r '.id')
123226
echo "package_id=${PACKAGE_ID}" >> $GITHUB_ENV
124227
echo "package_file=${PACKAGE_FILE}" >> $GITHUB_ENV
125228
printf "\n ⚡ Universal SHA256: $(sha256sum "${PACKAGE_FILE}") \n"
126-
127-
- name: Upload Universal .s9pk
128-
uses: actions/upload-artifact@v4
129-
with:
130-
name: ${{ env.package_file }}
131-
path: ./${{ env.package_file }}

0 commit comments

Comments
 (0)