Publish Haddocks from CI as part of release #526
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 | |
- id: stack | |
uses: freckle/stack-action@pb/typescript | |
with: | |
stack-yaml: ${{ matrix.stack-yaml }} | |
stack-build-arguments: | | |
${{ matrix.stack-yaml == 'stack.yaml' && '--haddock --haddock-for-hackage' || '' }} | |
env: | |
OTEL_TRACES_EXPORTER: none | |
# Upload docs from the stack.yaml build | |
- if: ${{ matrix.stack-yaml == 'stack.yaml' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: ${{ steps.stack.outputs.dist-dir}}/freckle-app-*-docs.tar.gz | |
if-no-files-found: error | |
# Create and upload dist with oldest resolver, to set lower bounds | |
- if: ${{ matrix.stack-yaml == 'stack-lts-18.28.yaml' }} | |
id: dist | |
run: | | |
stack sdist --pvp-bounds lower . | |
echo "dir=$(stack path --dist-dir)" >>"$GITHUB_OUTPUT" | |
env: | |
STACK_YAML: ${{ matrix.stack-yaml }} | |
- if: ${{ matrix.stack-yaml == 'stack-lts-18.28.yaml' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: ${{ steps.stack.outputs.dist-dir}}/freckle-app-*.tar.gz | |
if-no-files-found: error | |
release: | |
#if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
- id: tag | |
#uses: freckle/haskell-tag-action@v1 | |
run: | | |
echo "tag=v1.12.0.1" >>"$GITHUB_OUTPUT" | |
echo "version=1.12.0.1" >>"$GITHUB_OUTPUT" | |
- if: ${{ steps.tag.outputs.tag }} | |
run: | | |
# `stack upload`, conveniently can just be given the tar path. | |
#stack upload ./dist/freckle-app-$VERSION.tar.gz | |
# But `stack upload -d`, apparently, needs the file to reside in the | |
# expected place, so we'll copy it there first. | |
mkdir -p "$(stack path --dist-dir)" | |
cp -v "./docs/freckle-app-$VERSION-docs.tar.gz" "$(stack path --dist-dir)"/ | |
stack upload --documentation . | |
env: | |
VERSION: ${{ steps.tag.outputs.version }} | |
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 |