Publish Haddocks from CI as part of release #519
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
memcached: | |
image: memcached:1.6.14 | |
ports: | |
- 11211:11211 | |
options: >- | |
--health-cmd "bash -c 'echo >/dev/tcp/127.0.0.1/11211'" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
strategy: | |
matrix: | |
stack-yaml: | |
# has been failing, which now prevents release | |
#- stack-nightly.yaml # ghc-9.6 | |
- stack.yaml # ghc-9.4 | |
- stack-lts-20.26.yaml # ghc-9.2 | |
- stack-lts-19.33.yaml # ghc-9.0 | |
- stack-lts-18.28.yaml # ghc-8.10 | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install rdkafka | |
run: sudo apt-get install --assume-yes --no-install-recommends librdkafka-dev | |
- uses: freckle/stack-action@pb/typescript | |
with: | |
stack-yaml: ${{ matrix.stack-yaml }} | |
stack-build-arguments-build: | | |
${{ matrix.stack-yaml == 'stack.yaml' && '--haddock --haddock-for-hackage' || '' }} | |
env: | |
OTEL_TRACES_EXPORTER: none | |
- if: ${{ matrix.stack-yaml == 'stack.yaml' }} | |
id: dist | |
run: | | |
stack sdist --pvp-bounds lower . | |
echo "dir=$(stack path --dist-dir)" >>"$GITHUB_OUTPUT" | |
env: | |
# Use oldest resolver, to set lower bounds | |
STACK_YAML: stack-lts-18.28.yaml | |
- if: ${{ matrix.stack-yaml == 'stack.yaml' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: | | |
${{ steps.dist.outputs.dir}}/freckle-app-*.tar.gz | |
${{ steps.dist.outputs.dir}}/freckle-app-*-docs/* | |
if-no-files-found: error | |
release: | |
#if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- id: tag | |
#uses: freckle/haskell-tag-action@v1 | |
run: | | |
echo "tag=v1.12.0.1" >>"$GITHUB_OUTPUT" | |
- if: ${{ steps.tag.outputs.tag }} | |
uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
- if: ${{ steps.tag.outputs.tag }} | |
run: | | |
version=${TAG/v/} | |
stack upload ./freckle-app-$version.tar.gz | |
stack upload --documentation . | |
env: | |
TAG: ${{ steps.tag.outputs.tag }} | |
HACKAGE_KEY: ${{ secrets.HACKAGE_UPLOAD_API_KEY }} | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: haskell-actions/hlint-setup@v2 | |
- uses: haskell-actions/hlint-run@v2 | |
with: | |
fail-on: warning |