forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
72 lines (60 loc) · 1.99 KB
/
changelogs.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
name: Changelogs
on:
push:
branches:
- master
paths:
- 'changelog.d/*'
- '.github/workflows/changelogs.yml'
pull_request:
paths:
- 'changelog.d/*'
- '.github/workflows/changelogs.yml'
release:
types:
- created
defaults:
run:
shell: bash
jobs:
build:
name: Changelogs
runs-on: ubuntu-latest
steps:
# Cannot install changelog-d directly from remote tarball due to
# https://github.com/haskell/cabal/issues/7360
# Also, we would like to get the build plan for the cache key.
- name: Fetch changelog-d
run: |
changelog_d_latest="$(curl https://codeberg.org/api/v1/repos/fgaz/changelog-d/branches/master | jq -r .commit.id)"
echo "Using changelog-d revision $changelog_d_latest"
curl "https://codeberg.org/fgaz/changelog-d/archive/$changelog_d_latest.tar.gz" -o changelog-d.tar.gz
tar -xf changelog-d.tar.gz
- name: Update Hackage index
run: cabal v2-update
- name: Build plan for changelog-d
working-directory: changelog-d
run: |
cabal v2-build --dry-run --allow-newer=changelog-d:base
- name: Restore dependencies of changelog-d
uses: actions/cache/restore@v4
id: cache
with:
path: ~/.local/state/cabal
key: linux-store-changelogs-${{ hashfiles('changelog-d/dist-newstyle/cache/plan.json') }}
restore-keys: linux-store-changelogs
- name: Install changelog-d
working-directory: changelog-d
run: |
cabal v2-install --allow-newer=changelog-d:base
- name: Cache dependencies of changelog-d
uses: actions/cache/save@v4
if: always() && steps.cache.outputs.cache-hit != 'true'
with:
path: ~/.local/state/cabal
key: ${{ steps.cache.outputs.cache-primary-key }}
- name: Checkout cabal sources
uses: actions/checkout@v4
- name: Run changelog-d
run: |
changelog-d changelog.d