ci/docs: use version-info.toml
Some checks are pending
Publish every Git push to main to FlakeHub / flakehub-publish (push) Waiting to run
Publish every git push to Flakestry / publish-flake (push) Waiting to run
Documentation / Version info (push) Waiting to run
Documentation / Build (push) Blocked by required conditions
Documentation / Combine builds (push) Blocked by required conditions
Documentation / Deploy (push) Blocked by required conditions

This commit is contained in:
Matt Sturgeon 2025-06-16 18:05:35 +01:00
parent 6a054de04d
commit ab0a3682cc

View file

@ -13,27 +13,72 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
prepare:
name: Version info
runs-on: ubuntu-24.04-arm
outputs:
matrix: ${{ steps.matrix.outputs.result }}
versions: ${{ steps.versions.outputs.result }}
steps:
- name: Checkout version-info
uses: actions/checkout@v4
with:
sparse-checkout: version-info.toml
sparse-checkout-cone-mode: false
- name: Produce build matrix
id: matrix
uses: mikefarah/yq@master
with:
cmd: |
yq --no-colors --output-format=json '
[
.versions
| to_entries
| reverse
| .[]
| {
"ref": .value.branch,
"name": .key,
"base-href": "/nixvim/"
}
| select(.ref != "main").sub-path = .name
| select(.ref != "main").base-href += .name + "/"
]
' version-info.toml
- name: Produce "other versions" array
id: versions
uses: mikefarah/yq@master
with:
cmd: |
yq --no-colors --output-format=json '
[
.versions
| to_entries
| reverse
| .[]
| {
"branch": .value.branch,
"nixpkgsBranch": .value.channel,
"baseHref": "/nixvim/\(.key)/"
}
| select(.branch == "main").baseHref = "/nixvim/"
]
' version-info.toml
# TODO: add channel status
build: build:
name: Build ${{ matrix.name }} name: Build ${{ matrix.name }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: prepare
strategy: strategy:
fail-fast: true fail-fast: true
matrix: matrix:
# TODO: generate matrix from version-info.toml include: ${{ fromJSON(needs.prepare.outputs.matrix) }}
include:
- name: unstable
ref: main
sub-path: ""
base-href: /nixvim/
- name: "25.05"
ref: nixos-25.05
sub-path: "25.05"
base-href: /nixvim/25.05/
- name: "24.11"
ref: nixos-24.11
sub-path: "24.11"
base-href: /nixvim/24.11/
steps: steps:
- name: Install nix - name: Install nix
@ -57,25 +102,7 @@ jobs:
artifact-name: ${{ matrix.name }}-docs artifact-name: ${{ matrix.name }}-docs
sub-path: ${{ matrix.sub-path }} sub-path: ${{ matrix.sub-path }}
base-href: ${{ matrix.base-href }} base-href: ${{ matrix.base-href }}
# TODO: generate JSON from version-info.toml versions: ${{ needs.prepare.outputs.versions }}
versions: >
[
{
"branch": "main",
"nixpkgsBranch": "nixos-unstable",
"baseHref": "/nixvim/"
},
{
"branch": "nixos-25.05",
"nixpkgsBranch": "nixos-25.05",
"baseHref": "/nixvim/25.05/"
},
{
"branch": "nixos-24.11",
"nixpkgsBranch": "nixos-24.11",
"baseHref": "/nixvim/24.11/"
}
]
combine: combine:
name: Combine builds name: Combine builds