Skip to content

Commit 7e56e20

Browse files
committedFeb 6, 2023
Improve release workflow
- Trigger on release, rather than tag push - Also support test runs - Only ever upload package candidates
1 parent 011a560 commit 7e56e20

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed
 

‎.github/workflows/hackage.yml

+13-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
name: hackage
1+
name: "Release"
22

33
on:
44
push:
5-
tags:
6-
- "wai-saml2-*"
5+
paths:
6+
- ".github/workflows/hackage.yml"
7+
release:
8+
types:
9+
- released
10+
- prereleased
711

812
jobs:
913
publish-to-hackage:
@@ -22,12 +26,16 @@ jobs:
2226

2327
- name: Configure stack
2428
run: |
29+
echo ${{ github.event.action }}
2530
mkdir -p ${{ steps.install-haskell.outputs.stack-root }}
2631
echo "save-hackage-creds: false" >> ${{ steps.install-haskell.outputs.stack-root }}/config.yaml
2732
33+
- name: Check source distribution
34+
run: stack sdist .
35+
2836
- name: Publish `wai-saml2`
29-
if: startsWith(github.ref, 'refs/tags/wai-saml2-')
30-
run: stack upload .
37+
if: startsWith(github.ref, 'refs/tags/wai-saml2-') && github.event.action == 'released'
38+
run: stack upload . --candidate
3139
env:
3240
HACKAGE_USERNAME: ${{ secrets.HACKAGE_USER }}
3341
HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }}

0 commit comments

Comments
 (0)
Please sign in to comment.