Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish to Hackage Workflow #255

Open
BebeSparkelSparkel opened this issue Dec 12, 2024 · 1 comment
Open

Publish to Hackage Workflow #255

BebeSparkelSparkel opened this issue Dec 12, 2024 · 1 comment
Labels
workflow github workflow

Comments

@BebeSparkelSparkel
Copy link
Collaborator

BebeSparkelSparkel commented Dec 12, 2024

A workflow to publish to hackage.

name: Publish to Hackage

on:
  push:
    tags:
      - 'v*'

jobs:
  upload:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Set up cabal
        uses: haskell/actions/setup@v2
        with:
          ghc-version: '8.10.7'
          cabal-version: '3.4'

      - name: Build dependencies
        run: cabal update && cabal build --only-dependencies

      - name: Build package
        run: cabal build

      - name: Generate sdist
        run: cabal sdist

      - name: Upload to Hackage
        env:
          HACKAGE_USERNAME: ${{ secrets.HACKAGE_USERNAME }}
          HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }}
        run: |
          cabal upload dist-newstyle/sdist/mono-traversable-<version>.tar.gz
        # Note: Replace `<version>` with your actual package version or use environment variables.

      - name: Upload Documentation
        env:
          HACKAGE_USERNAME: ${{ secrets.HACKAGE_USERNAME }}
          HACKAGE_PASSWORD: ${{ secrets.HACKAGE_PASSWORD }}
        run: |
          cabal haddock --haddock-for-hackage
          cabal upload -d dist-newstyle/doc/html/mono-traversable-<version>-docs.tar.gz

#253

@BebeSparkelSparkel BebeSparkelSparkel added the workflow github workflow label Dec 12, 2024
@snoyberg
Copy link
Owner

I don't have any Hackage account for automated uploads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
workflow github workflow
Projects
None yet
Development

No branches or pull requests

2 participants