Skip to content

Check version of nixos-search #597

Check version of nixos-search

Check version of nixos-search #597

Workflow file for this run

name: "Check version of nixos-search"
on:
schedule:
- cron: '0 */12 * * *'
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: cachix/install-nix-action@v31
- name: Check nixos-search version
run: |
# Upstream stores backend and "import" versions in a `version.nix` file.
# I can't really tell the difference, but the "backend" key seems to be
# for migrations, and the "import" key is what we're looking for.
curl -fsSL https://raw.githubusercontent.com/nixos/nixos-search/main/version.nix -o version.nix
VERSION_CONTENT=$(nix eval --raw --file ./version.nix import)
# NOTE: this number and the version number in src/search.rs have
# to be updated when nixos-search updates it's version number.
VERSION_NUMBER=44
echo "Found VERSION: $VERSION_CONTENT"
if [ "$VERSION_CONTENT" != "$VERSION_NUMBER" ]; then
echo "::error:: Expected version $VERSION_NUMBER, but found $VERSION_CONTENT"
exit 1
fi
echo "Version check passed. nixos-search version is $VERSION_NUMBER."