Skip to content

Commit

Permalink
fix(docker): Work around GH Actions env limitations, copied from Font…
Browse files Browse the repository at this point in the history
…ship
  • Loading branch information
alerque committed Dec 11, 2020
1 parent de4db95 commit 66cfbaf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ ARG VCS_REF=0
COPY ./ /src
WORKDIR /src

RUN git clean -dxf ||:
RUN git fetch --unshallow ||:
RUN git fetch --tags ||:
# GitHub Actions builder stopped providing git history :(
# See feature request at https://github.com/actions/runner/issues/767
RUN build-aux/bootstrap-docker.sh

RUN ./bootstrap.sh
RUN ./configure
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ datadir = $(datarootdir)/$(_casile)
dist_doc_DATA = README.md CHANGELOG.md
dist_license_DATA = LICENSE.txt

EXTRA_DIST = package.json yarn.lock Dockerfile build-aux/cargo-updater.js
EXTRA_DIST = package.json yarn.lock Dockerfile build-aux/cargo-updater.js build-aux/bootstrap-docker.sh

bin_PROGRAMS = casile

Expand Down
12 changes: 12 additions & 0 deletions build-aux/bootstrap-docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh
set -e

# GitHub Actions runner gives us jack squat
if [ ! -e ".git" ]; then
jq -Mer '.version + "-unknown"' package.json > .tarball-version

# Docker Hub gives us a Git working directory, but with depth=1
else
git fetch --unshallow ||:
git fetch --tags ||:
fi

0 comments on commit 66cfbaf

Please sign in to comment.