-
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.25 KB
/
generate.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: "Generate package database"
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Create databases
run: |
sleep $((RANDOM % 60))
for Line in $(cat versions)
do
PREV_VERSION=$(cat $Line/nixpkgs.ver)
RUST_LOG=generator=trace nix develop --command -- generator -v $Line --src $Line 1>&2
NEW_VERSION=$(cat $Line/nixpkgs.ver)
if [ "$PREV_VERSION" != "$NEW_VERSION" ]; then
if [ -f "$Line/nixpkgs.db" ]; then
brotli ./$Line/nixpkgs.db -o ./$Line/nixpkgs.db.br -v -f 1>&2
fi
if [ -f "$Line/nixpkgs_versions.db" ]; then
brotli ./$Line/nixpkgs_versions.db -o ./$Line/nixpkgs_versions.db.br -v -f 1>&2
fi
fi
done
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update databases
commit_user_email: [email protected]
commit_author: GitHub Actions <[email protected]>