Skip to content

Commit 5132451

Browse files
Merge pull request #363 from SixLabors/js/fonts-and-license-infra
Update refs and submodule; update workflow
2 parents 7160a39 + 34bbd3c commit 5132451

File tree

3 files changed

+50
-9
lines changed

3 files changed

+50
-9
lines changed

.github/workflows/build-and-test.yml

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,52 @@ on:
1111
- main
1212
types: [ labeled, opened, synchronize, reopened ]
1313
jobs:
14+
# Prime a single LFS cache and expose the exact key for the matrix
15+
WarmLFS:
16+
runs-on: ubuntu-latest
17+
outputs:
18+
lfs_key: ${{ steps.expose-key.outputs.lfs_key }}
19+
steps:
20+
- name: Git Config
21+
shell: bash
22+
run: |
23+
git config --global core.autocrlf false
24+
git config --global core.longpaths true
25+
26+
- name: Git Checkout
27+
uses: actions/checkout@v4
28+
with:
29+
fetch-depth: 0
30+
submodules: recursive
31+
32+
# Deterministic list of LFS object IDs, then compute a portable key:
33+
# - `git lfs ls-files -l` lists all tracked LFS objects with their SHA-256
34+
# - `awk '{print $1}'` extracts just the SHA field
35+
# - `sort` sorts in byte order (hex hashes sort the same everywhere)
36+
# This ensures the file content is identical regardless of OS or locale
37+
- name: Git Create LFS id list
38+
shell: bash
39+
run: git lfs ls-files -l | awk '{print $1}' | sort > .lfs-assets-id
40+
41+
- name: Git Expose LFS cache key
42+
id: expose-key
43+
shell: bash
44+
env:
45+
LFS_KEY: lfs-${{ hashFiles('.lfs-assets-id') }}-v1
46+
run: echo "lfs_key=$LFS_KEY" >> "$GITHUB_OUTPUT"
47+
48+
- name: Git Setup LFS Cache
49+
uses: actions/cache@v4
50+
with:
51+
path: .git/lfs
52+
key: ${{ steps.expose-key.outputs.lfs_key }}
53+
54+
- name: Git Pull LFS
55+
shell: bash
56+
run: git lfs pull
57+
1458
Build:
59+
needs: WarmLFS
1560
strategy:
1661
matrix:
1762
isARM:
@@ -88,16 +133,12 @@ jobs:
88133
fetch-depth: 0
89134
submodules: recursive
90135

91-
# See https://github.com/actions/checkout/issues/165#issuecomment-657673315
92-
- name: Git Create LFS FileList
93-
run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
94-
136+
# Use the warmed key from WarmLFS. Do not recompute or recreate .lfs-assets-id here.
95137
- name: Git Setup LFS Cache
96138
uses: actions/cache@v4
97-
id: lfs-cache
98139
with:
99140
path: .git/lfs
100-
key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1
141+
key: ${{ needs.WarmLFS.outputs.lfs_key }}
101142

102143
- name: Git Pull LFS
103144
run: git lfs pull

src/ImageSharp.Drawing/ImageSharp.Drawing.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
<None Include="..\..\shared-infrastructure\branding\icons\imagesharp.drawing\sixlabors.imagesharp.drawing.128.png" Pack="true" PackagePath="" />
4646
</ItemGroup>
4747
<ItemGroup>
48-
<PackageReference Include="SixLabors.Fonts" Version="2.1.3" />
49-
<PackageReference Include="SixLabors.ImageSharp" Version="4.0.0-alpha.0.26" />
48+
<PackageReference Include="SixLabors.Fonts" Version="3.0.0-alpha.0.1" />
49+
<PackageReference Include="SixLabors.ImageSharp" Version="4.0.0-alpha.0.44" />
5050
</ItemGroup>
5151
<Import Project="..\..\shared-infrastructure\src\SharedInfrastructure\SharedInfrastructure.projitems" Label="Shared" />
5252
</Project>

0 commit comments

Comments
 (0)