-
Notifications
You must be signed in to change notification settings - Fork 18
47 lines (40 loc) · 1.84 KB
/
update.yaml
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
name: "Update hackage.nix"
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
jobs:
update-hackage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "Checkout the for-stackage branch"
run: |
git fetch --depth=1 origin for-stackage:for-stackage
git checkout for-stackage
- uses: cachix/install-nix-action@v15
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= loony-tools:pr9m4BkM/5/eSTZlkQyRt57Jz7OMBxNSUiMC4FkcNfk= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
substituters = https://cache.iog.io https://cache.zw3rk.com https://cache.nixos.org/
- name: "Update hackage.nix and stackage.nix"
run: |
export CABAL_DIR=$HOME/.cabal
nix run github:input-output-hk/haskell.nix#cabal -- v2-update
nix run github:input-output-hk/haskell.nix#hackage-to-nix -- . $CABAL_DIR/packages/hackage.haskell.org/01-index.tar
nix run github:input-output-hk/haskell.nix#haskell-nix.update-index-state-hashes > index-state-hashes.nix
- name: "Commit and push changes to the for-stackage branch"
run: |
git config --local user.email "[email protected]"
git config --local user.name "IOHK"
git add .
git commit -m "Automatic Update" || echo "No changes to commit"
git push --set-upstream origin for-stackage
- name: "Update master branch with index-state-hashes.nix"
run: |
git checkout master
git checkout for-stackage -- index-state-hashes.nix
git add index-state-hashes.nix
git commit -m "Update index-state-hashes.nix" || echo "No changes to commit"
git push