-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (52 loc) · 1.63 KB
/
release.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
name: Release
on: workflow_dispatch
jobs:
ci:
uses: ./.github/workflows/ci.yml
release:
runs-on: ubuntu-latest
needs:
- ci
steps:
-
uses: actions/checkout@v3
-
uses: actions/download-artifact@v3
with:
name: persistent-mtl-sdist
path: ./sdist/
-
id: cabal_file
uses: haskell-actions/parse-cabal-file@v1
with:
cabal_file: persistent-mtl.cabal
-
name: Set version label
run: echo 'VERSION=v${{ steps.cabal_file.outputs.version }}' >> "${GITHUB_ENV}"
-
id: hackage_token_secret
name: Load Hackage token secret name
run: |
USERNAME="$(echo "${GITHUB_ACTOR}" | tr '[:lower:]' '[:upper:]' | tr '-' '_')"
echo "name=HACKAGE_TOKEN_${USERNAME}" >> "${GITHUB_OUTPUT}"
-
name: Get CHANGELOG section
run: |
sed '/^# Unreleased/,/^$/d' CHANGELOG.md > /tmp/changelog-without-unreleased
if [[ "$(head -n 1 /tmp/changelog-without-unreleased)" != "# ${VERSION}" ]]; then
echo "CHANGELOG doesn't look updated" >&2
exit 1
fi
sed '1 d; /^# v/,$ d' /tmp/changelog-without-unreleased > /tmp/changelog-body
-
uses: haskell-actions/hackage-publish@v1
with:
hackageToken: ${{ secrets[steps.hackage_token_secret.outputs.name] }}
packagesPath: ./sdist/
-
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ env.VERSION }}
body_path: /tmp/changelog-body
draft: true
target_commitish: ${{ github.sha }}