@@ -13,27 +13,72 @@ concurrency:
13
13
cancel-in-progress : true
14
14
15
15
jobs :
16
+ prepare :
17
+ name : Version info
18
+ runs-on : ubuntu-24.04-arm
19
+
20
+ outputs :
21
+ matrix : ${{ steps.matrix.outputs.result }}
22
+ versions : ${{ steps.versions.outputs.result }}
23
+
24
+ steps :
25
+ - name : Checkout version-info
26
+ uses : actions/checkout@v4
27
+ with :
28
+ sparse-checkout : version-info.toml
29
+ sparse-checkout-cone-mode : false
30
+
31
+ - name : Produce build matrix
32
+ id : matrix
33
+ uses : mikefarah/yq@master
34
+ with :
35
+ cmd : |
36
+ yq --no-colors --output-format=json '
37
+ [
38
+ .versions
39
+ | to_entries
40
+ | reverse
41
+ | .[]
42
+ | {
43
+ "ref": .value.branch,
44
+ "name": .key,
45
+ "base-href": "/nixvim/"
46
+ }
47
+ | select(.ref != "main").sub-path = .name
48
+ | select(.ref != "main").base-href += .name + "/"
49
+ ]
50
+ ' version-info.toml
51
+
52
+ - name : Produce "other versions" array
53
+ id : versions
54
+ uses : mikefarah/yq@master
55
+ with :
56
+ cmd : |
57
+ yq --no-colors --output-format=json '
58
+ [
59
+ .versions
60
+ | to_entries
61
+ | reverse
62
+ | .[]
63
+ | {
64
+ "branch": .value.branch,
65
+ "nixpkgsBranch": .value.channel,
66
+ "baseHref": "/nixvim/\(.key)/"
67
+ }
68
+ | select(.branch == "main").baseHref = "/nixvim/"
69
+ ]
70
+ ' version-info.toml
71
+ # TODO: add channel status
72
+
16
73
build :
17
74
name : Build ${{ matrix.name }}
18
75
runs-on : ubuntu-latest
76
+ needs : prepare
19
77
20
78
strategy :
21
79
fail-fast : true
22
80
matrix :
23
- # TODO: generate matrix from version-info.toml
24
- include :
25
- - name : unstable
26
- ref : main
27
- sub-path : " "
28
- base-href : /nixvim/
29
- - name : " 25.05"
30
- ref : nixos-25.05
31
- sub-path : " 25.05"
32
- base-href : /nixvim/25.05/
33
- - name : " 24.11"
34
- ref : nixos-24.11
35
- sub-path : " 24.11"
36
- base-href : /nixvim/24.11/
81
+ include : ${{ fromJSON(needs.prepare.outputs.matrix) }}
37
82
38
83
steps :
39
84
- name : Install nix
@@ -57,25 +102,7 @@ jobs:
57
102
artifact-name : ${{ matrix.name }}-docs
58
103
sub-path : ${{ matrix.sub-path }}
59
104
base-href : ${{ matrix.base-href }}
60
- # TODO: generate JSON from version-info.toml
61
- versions : >
62
- [
63
- {
64
- "branch": "main",
65
- "nixpkgsBranch": "nixos-unstable",
66
- "baseHref": "/nixvim/"
67
- },
68
- {
69
- "branch": "nixos-25.05",
70
- "nixpkgsBranch": "nixos-25.05",
71
- "baseHref": "/nixvim/25.05/"
72
- },
73
- {
74
- "branch": "nixos-24.11",
75
- "nixpkgsBranch": "nixos-24.11",
76
- "baseHref": "/nixvim/24.11/"
77
- }
78
- ]
105
+ versions : ${{ needs.prepare.outputs.versions }}
79
106
80
107
combine :
81
108
name : Combine builds
0 commit comments