Update nur-search fix

This commit is contained in:
Gavin John 2025-02-13 13:58:28 -08:00
parent 328ee73e1a
commit 1867eb5034
2 changed files with 24 additions and 9 deletions

View file

@ -97,12 +97,34 @@ jobs:
permissions: "contents:write"
revoke_token: true
- uses: actions/checkout@v4
with:
repository: nix-community/NUR
fetch-depth: '0'
path: nur
- uses: actions/checkout@v4
with:
repository: nix-community/nur-combined
fetch-depth: '0'
submodules: 'recursive'
path: nur-combined
- uses: actions/checkout@v4
with:
repository: nix-community/nur-search
fetch-depth: '0'
path: nur-search
- uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
experimental-features = nix-command flakes
- name: update nur-search/data/packages.json
run: ./ci/update-nur-search.sh
run: ./nur/ci/update-nur-search.sh
env:
API_TOKEN_GITHUB: '${{ steps.get_workflow_token.outputs.token }}'
- name: rebase and push
run: |
source ./nur/ci/lib/setup-git.sh
git -C $GITHUB_WORKSPACE/nur-search pull --rebase origin master
git -C $GITHUB_WORKSPACE/nur-search push origin HEAD:master
env:
GITHUB_TOKEN: ${{ steps.get_workflow_token.outputs.token }}

View file

@ -14,11 +14,7 @@ set -x
nix build "${DIR}#"
cd "${DIR}/.."
git clone --single-branch "https://${API_TOKEN_GITHUB:-git}@github.com/nix-community/nur-combined.git" || git -C nur-combined pull
git clone --recurse-submodules "https://${API_TOKEN_GITHUB:-git}@github.com/nix-community/nur-search.git" || git -C nur-search pull
cd "${DIR}/../.."
nix run "${DIR}#" -- index nur-combined > nur-search/data/packages.json
@ -29,9 +25,6 @@ cd nur-search
if [[ ! -z "$(git diff --exit-code)" ]]; then
git add ./data/packages.json
git commit -m "automatic update package.json"
git pull --rebase origin master
git push origin master
nix-shell --run "make clean && make && make publish"
else
echo "nothings changed will not commit anything"
fi