1
- name : Assorted
1
+ name : Changelogs
2
2
3
3
on :
4
4
push :
@@ -25,41 +25,48 @@ jobs:
25
25
runs-on : ubuntu-latest
26
26
27
27
steps :
28
- - name : Set PATH
29
- # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
30
- run : |
31
- echo "$HOME/.cabal/bin" >> $GITHUB_PATH
32
- - uses : actions/cache@v3
33
- with :
34
- path : ~/.cabal/store
35
- key : linux-store-changelogs
36
- # See https://github.com/haskell/cabal/pull/8739
37
- - name : Sudo chmod to permit ghcup to update its cache
38
- run : |
39
- if [[ "${{ runner.os }}" == "Linux" ]]; then
40
- sudo mkdir -p /usr/local/.ghcup/cache
41
- sudo chown -R $USER /usr/local/.ghcup
42
- sudo chmod -R 777 /usr/local/.ghcup
43
- fi
44
- - name : ghcup
28
+
29
+ # Cannot install changelog-d directly from remote tarball due to
30
+ # https://github.com/haskell/cabal/issues/7360
31
+ # Also, we would like to get the build plan for the cache key.
32
+ - name : Fetch changelog-d
45
33
run : |
46
- ghcup config set cache true
47
- ghcup install ghc recommended
48
- ghcup set ghc recommended
34
+ changelog_d_latest="$(curl https://codeberg.org/api/v1/repos/fgaz/changelog-d/branches/master | jq -r .commit.id)"
35
+ echo "Using changelog-d revision $changelog_d_latest"
36
+ curl "https://codeberg.org/fgaz/changelog-d/archive/$changelog_d_latest.tar.gz" -o changelog-d.tar.gz
37
+ tar -xf changelog-d.tar.gz
38
+
49
39
- name : Update Hackage index
50
40
run : cabal v2-update
51
- # Cannot install it from tarball due to
52
- # https://github.com/haskell/cabal/issues/7360
53
- - uses : actions/checkout@v4
41
+
42
+ - name : Build plan for changelog-d
43
+ working-directory : changelog-d
44
+ run : |
45
+ cabal v2-build --dry-run --allow-newer=changelog-d:base
46
+
47
+ - name : Restore dependencies of changelog-d
48
+ uses : actions/cache/restore@v4
49
+ id : cache
54
50
with :
55
- repository : " fgaz/changelog-d"
56
- path : " changelog-d"
51
+ path : ~/.local/state/cabal
52
+ key : linux-store-changelogs-${{ hashfiles('changelog-d/dist-newstyle/cache/plan.json') }}
53
+ restore-keys : linux-store-changelogs
54
+
57
55
- name : Install changelog-d
56
+ working-directory : changelog-d
58
57
run : |
59
- pushd changelog-d
60
- cabal v2-install
61
- popd
62
- - uses : actions/checkout@v4
58
+ cabal v2-install --allow-newer=changelog-d:base
59
+
60
+ - name : Cache dependencies of changelog-d
61
+ uses : actions/cache/save@v4
62
+ if : always() && steps.cache.outputs.cache-hit != 'true'
63
+ with :
64
+ path : ~/.local/state/cabal
65
+ key : ${{ steps.cache.outputs.cache-primary-key }}
66
+
67
+ - name : Checkout cabal sources
68
+ uses : actions/checkout@v4
69
+
63
70
- name : Run changelog-d
64
71
run : |
65
72
changelog-d changelog.d
0 commit comments