Skip to content

Bump version

Bump version #13

Workflow file for this run

name: Publish Package
on:
push:
branches:
- main
env:
HACKAGE_USERNAME: ${{ secrets.HACKAGE_USERNAME }}
HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }}
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- uses: haskell/actions/setup@v2
with:
ghc-version: "9.6.4" # Exact version of ghc to use
# cabal-version: 'latest'. Omitted, but defaults to 'latest'
enable-stack: true
stack-version: "2.15.1"
# Attempt to load cached dependencies
- name: Cache Stack dependencies
uses: actions/cache@v2
with:
path: |
~/.stack
.stack-work
key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml') }}
- name: Bump version field
run: |
if grep -q "feat" <<< "$GITHUB_REF"; then
echo "feat: bumping minor version"
stack exec bump-version minor package.yaml
elif grep -q "fix" <<< "$GITHUB_REF"; then
echo "fix: bumping patch version"
stack exec bump-version patch package.yaml
elif grep -q "breaking" <<< "$GITHUB_REF"; then
echo "breaking: bumping major version"
stack exec bump-version major package.yaml
else
echo "no version bump required"
fi
- name: Publish to Hackage
run: stack upload .
env:
HACKAGE_USERNAME: ${{ secrets.HACKAGE_USERNAME }}
HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }}
# Attempt to load cached dependencies
- name: Cache Stack dependencies
uses: actions/cache@v2
with:
path: |
~/.stack
.stack-work
key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml') }}
- name: Push changes
uses: ad-m/github-push-action@master
with:
branch: main
force: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}