Skip to content

Bytezap: fix deprecation warnings #79

Bytezap: fix deprecation warnings

Bytezap: fix deprecation warnings #79

Workflow file for this run

# GitHub Actions worflow to build Hackage artifacts for a project: an sdist
# archive, and Haddock docs for uploading to Hackage.
#
# I would love to do this in the same testing workflows, so we're not wasting
# GitHub's resources, but workflow syntax is debilitating and they strip docs in
# their provided GHCs, so there's too much complexity to handle it in one place.
#
# This workflow is based on the expectation that GitHub's runners install GHC
# using ghcup with default settings (installs GHCs to `~/.ghcup/ghc/$VERSION`).
#
# TODO: Had to disable project caching (dist-newstyle) because cabal apparently
# forgets to rebuild the documentation if it's not there if the code doesn't
# change. Dumb.
name: Hackage artifacts
on:
push:
branches:
- main
env:
# ghcup needs full version string (e.g. 9.0.1, not 9.0)
ghc: "9.2.4"
package_name: binrep
jobs:
hackage:
runs-on: ubuntu-latest
name: Hackage artifacts
steps:
# TODO: GHC decides to recompile based on timestamp, so cache isn't used
# Preferably GHC would work via hashes instead. Stack had this feature
# merged in Aug 2020.
# Upstream GHC issue: https://gitlab.haskell.org/ghc/ghc/-/issues/16495
# My issue on haskell/actions: https://github.com/haskell/actions/issues/41
# This also requires us to do a deep fetch, else we don't get the Git commit
# history we need to rewrite mod times.
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set all tracked file modification times to the time of their last commit
run: |
rev=HEAD
for f in $(git ls-tree -r -t --full-name --name-only "$rev") ; do
touch -d $(git log --pretty=format:%cI -1 "$rev" -- "$f") "$f";
done
- name: Delete preinstalled docs-stripped GHC ${{ env.ghc }}
run: ghcup rm ghc ${{ env.ghc }}
if: always()
- name: Install GHC ${{ env.ghc }}
run: ghcup install ghc --set ${{ env.ghc }}
- run: cabal update
- run: cabal freeze
- name: Cache global Cabal store
uses: actions/cache@v2
with:
path: ~/.cabal/store
key: hackage-deps-${{ runner.os }}-ghc_${{ env.ghc }}
# TODO 2022-04-22: --haddock-options=--quickjump fixes a bug with not
# propagating --haddock-quickjump to building dependency Haddocks
- run: cabal build --enable-documentation --haddock-for-hackage --haddock-options=--quickjump
- run: cabal sdist
- name: Upload Hackage sdist
uses: actions/upload-artifact@v2
with:
path: dist-newstyle/sdist/${{ env.package_name }}-*.tar.gz
name: ${{ env.package_name }}-sdist-${{ github.sha }}.tar.gz
if-no-files-found: error
- name: Upload Hackage Haddock docs
uses: actions/upload-artifact@v2
with:
path: dist-newstyle/${{ env.package_name }}-*-docs.tar.gz
name: ${{ env.package_name }}-hackage-haddocks-${{ github.sha }}.tar.gz
if-no-files-found: error
- name: Delete prepared tarballs (else can't extract just newest next time)
run: |
rm dist-newstyle/${{ env.package_name }}-*-docs.tar.gz
rm dist-newstyle/sdist/${{ env.package_name }}-*.tar.gz