-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (61 loc) · 2.1 KB
/
update-packages.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# This is a basic workflow to help you get started with Actions
name: Update NUR packages
# this will happen once a week
on:
schedule:
- cron: 0 0 * * 6
workflow_dispatch:
push:
paths:
- '.github/workflows/update-packages.yml'
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v4
- name: Setup fake git account
run: |
git config user.name "Monorepo bot :D"
git config user.email "[email protected]"
- name: Install Nix
uses: cachix/install-nix-action@v23
with:
extra_nix_config: |
experimental-features = nix-command flakes
nix_path: nixpkgs=channel:nixpkgs-unstable
# updates niv and javascript dependencies
- name: Update niv dependencies
run: |
GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} nix-shell -p niv --run "niv update"
(cd nix/ && $(nix-build --no-out-link ../pkgs -A nvfetcher --arg pkgs "import <nixpkgs> {}")/bin/nvfetcher -c nvfetcher.toml)
- name: Update flakes
run: |
./createFlakeNix.sh
git add -f flake.nix
nix flake update
git rm -f flake.nix
- name: Update JavaScript packages
run: |
nix-env -iA nix-gen-node-tools -f pkgs/default.nix
(cd pkgs && {
mv js old-js
mkdir js
mv old-js/default.nix js/
for i in $(ls old-js/); do
(cd js/ && nix-gen-node-tools $i)
done
rm -rf old-js/
})
- name: Create commit message
run: |
git add .
git commit -m "Automatic update of packages at $(date)"
- name: Push to master
uses: ad-m/[email protected]
with:
github_token: ${{secrets.GITHUB_TOKEN}}