-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (51 loc) · 1.52 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
56
57
58
59
60
61
62
63
64
65
name: Release
on:
push:
branches: main
workflow_dispatch:
jobs:
tag:
runs-on: ubuntu-latest
env:
SHA: ${{ github.sha }}
GH_TOKEN: ${{ github.token }}
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@v4
- id: tag
name: Tag
run: |
TAG=$(<version.txt)
if gh api "/repos/{owner}/{repo}/git/ref/tags/$TAG" &>/dev/null; then
echo "Tag $TAG exists already"
exit 0
fi
gh api '/repos/{owner}/{repo}/git/tags' \
--method POST \
--raw-field "tag=$TAG" \
--raw-field "message=$TAG" \
--raw-field "object=$SHA" \
--raw-field "type=commit"
gh api '/repos/{owner}/{repo}/git/refs' \
--method POST \
--raw-field "ref=refs/tags/$TAG" \
--raw-field "sha=$SHA"
echo "tag=$TAG" >>"$GITHUB_OUTPUT"
release:
needs: tag
if: needs.tag.outputs.tag
runs-on: ubuntu-latest
env:
HACKAGE_KEY: ${{ secrets.HACKAGE_UPLOAD_API_KEY }}
steps:
- uses: actions/checkout@v4
- name: "Build with Haddocks"
uses: freckle/stack-action@v5
with:
test: false
stack-build-arguments: --haddock --haddock-for-hackage
- name: "Release to Hackage"
run: stack --stack-yaml stack-lts20.yaml upload --pvp-bounds lower recurly-client
- name: "Upload documentation"
run: stack upload --documentation recurly-client