Skip to content

Commit

Permalink
Improve release workflow
Browse files Browse the repository at this point in the history
- Trigger on release, rather than tag push
- Also support test runs
- Only ever upload package candidates
  • Loading branch information
mbg committed Feb 6, 2023
1 parent 011a560 commit 7e56e20
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/hackage.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
name: hackage
name: "Release"

on:
push:
tags:
- "wai-saml2-*"
paths:
- ".github/workflows/hackage.yml"
release:
types:
- released
- prereleased

jobs:
publish-to-hackage:
Expand All @@ -22,12 +26,16 @@ jobs:

- name: Configure stack
run: |
echo ${{ github.event.action }}
mkdir -p ${{ steps.install-haskell.outputs.stack-root }}
echo "save-hackage-creds: false" >> ${{ steps.install-haskell.outputs.stack-root }}/config.yaml
- name: Check source distribution
run: stack sdist .

- name: Publish `wai-saml2`
if: startsWith(github.ref, 'refs/tags/wai-saml2-')
run: stack upload .
if: startsWith(github.ref, 'refs/tags/wai-saml2-') && github.event.action == 'released'
run: stack upload . --candidate
env:
HACKAGE_USERNAME: ${{ secrets.HACKAGE_USER }}
HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }}

0 comments on commit 7e56e20

Please sign in to comment.