git.iko.soy/rowtype-yoga/package-sets
on master help sign in
Automatically generate packages.json file on pull requests (#768)
commitaadfd068e2d942b1c1771be53261220adbc7d57b authorThomas Honeyman <admin@thomashoneyman.com> dateSat 19 Dec 2020, 07:56 (6 years ago) parentd3c6493
3 files changed+47−15
.github/workflows/main.yml+43−11 packages.json+2−2 src/groups/natefaubion.dhall+2−2
.github/workflows/main.yml+43−11
@@ -2,19 +2,51 @@ name: build
22
33on:
44 pull_request:
5+ branches: master
56 push:
7+ branches: master
8+
69jobs:
710 tests:
811 runs-on: ubuntu-latest
912 steps:
10− - uses: actions/checkout@v2
11− - uses: cachix/install-nix-action@v12
12− with:
13− nix_path: nixpkgs=channel:nixos-20.09
14− - uses: actions/cache@v2
15− with:
16− path: |
17− output
18− .psc-package
19− key: ${{ runner.os }}-build-products
20− - run: nix-shell --run 'make ci'
13+ - uses: actions/checkout@v2
14+ with:
15+ ref: ${{ github.event.pull_request.head.ref }}
16+ persist-credentials: false
17+
18+ - uses: cachix/install-nix-action@v12
19+ with:
20+ nix_path: nixpkgs=channel:nixos-20.09
21+
22+ - name: Generate packages.json file from the package set
23+ run: |
24+ # Generate the new packages.json file
25+ nix-shell --run 'make generate'
26+
27+ # Run verification steps
28+ nix-shell --run 'make verify-registry'
29+ nix-shell --run 'make test-psc-package'
30+
31+ - name: Check for and commit modified files
32+ id: git-check
33+ run: echo ::set-output name=modified::$(if git diff --quiet; then echo "false"; else echo "true"; fi)
34+
35+ - name: Push changes
36+ if: steps.git-check.outputs.modified == 'true'
37+ run: |
38+ git config --global user.name 'GitHub Action'
39+ git config --global user.email 'actions@github.com'
40+ git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}
41+ git pull --ff-only
42+ git commit -am "Update packages.json file"
43+ git push
44+
45+ - uses: actions/cache@v2
46+ with:
47+ path: |
48+ output
49+ .psc-package
50+ key: ${{ runner.os }}-build-products
51+
52+ - run: nix-shell --run 'cd src && spago verify-set'
packages.json+2−2
@@ -938,8 +938,8 @@
938938 "prelude",
939939 "strings"
940940 ],
941− "repo": "https://github.com/natefaubion/purescript-dodo-printer/",
942− "version": "v1.0.8"
941+ "repo": "https://github.com/natefaubion/purescript-dodo-printer.git",
942+ "version": "v1.0.9"
943943 },
944944 "dom-filereader": {
945945 "dependencies": [
src/groups/natefaubion.dhall+2−2
@@ -119,7 +119,7 @@
119119, dodo-printer =
120120 { dependencies =
121121 [ "ansi", "foldable-traversable", "lists", "maybe", "prelude", "strings" ]
122− , repo = "https://github.com/natefaubion/purescript-dodo-printer/"
123− , version = "v1.0.8"
122+ , repo = "https://github.com/natefaubion/purescript-dodo-printer.git"
123+ , version = "v1.0.9"
124124 }
125125}