Skip to content

Commit cfd4780

Browse files
committed
Move matrix load into custom action
1 parent 3ca6e5d commit cfd4780

File tree

2 files changed

+36
-20
lines changed

2 files changed

+36
-20
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: generate-image-matrix
2+
description: Loads image lists into output
3+
4+
outputs:
5+
images:
6+
description: "Image list"
7+
value: ${{ steps.images.outputs.images }}
8+
chapters:
9+
description: "Chapter list"
10+
value: ${{ steps.chapters.outputs.chapters }}
11+
12+
runs:
13+
using: "composite"
14+
steps:
15+
- name: Generate image matrix
16+
id: images
17+
working-directory: build/image-lists
18+
shell: pwsh
19+
run: |
20+
$list = $(cat images-linux.json)
21+
$out = "images=$list"
22+
echo $out
23+
$out >> $env:GITHUB_OUTPUT
24+
- name: Generate chapter matrix
25+
id: chapters
26+
working-directory: build/image-lists
27+
shell: pwsh
28+
run: |
29+
$list = $(cat chapters-linux.json)
30+
$out = "chapters=$list"
31+
echo $out
32+
$out >> $env:GITHUB_OUTPUT

.github/workflows/build-linux-amd64.yaml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,12 @@ jobs:
1212
define-matrices:
1313
runs-on: ubuntu-latest
1414
outputs:
15-
images: ${{ steps.images.outputs.images }}
16-
chapters: ${{ steps.chapters.outputs.chapters }}
15+
images: ${{ steps.generate.outputs.images }}
16+
chapters: ${{ steps.generate.outputs.chapters }}
1717
steps:
1818
- uses: actions/checkout@master
19-
- name: Generate image matrix
20-
id: images
21-
working-directory: build/image-lists
22-
shell: pwsh
23-
run: |
24-
$list = $(cat images-linux.json)
25-
$out = "images=$list"
26-
echo $out
27-
$out >> $env:GITHUB_OUTPUT
28-
- name: Generate chapter matrix
29-
id: chapters
30-
working-directory: build/image-lists
31-
shell: pwsh
32-
run: |
33-
$list = $(cat chapters-linux.json)
34-
$out = "chapters=$list"
35-
echo $out
36-
$out >> $env:GITHUB_OUTPUT
19+
- uses: ./.github/actions/generate-image-matrix
20+
id: generate
3721

3822
build-images-linux-amd64:
3923
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)