Skip to content

Commit

Permalink
Add packaging for standalone files
Browse files Browse the repository at this point in the history
In preparation for automatically deploying them to release pages.
  • Loading branch information
JasonGross committed Nov 9, 2023
1 parent 1097f58 commit b1fe2db
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/coq-debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ jobs:
name: generated-files-${{ matrix.env.DEBIAN }}
path: generated-files.tgz
if: ${{ failure() }}
- name: package-standalone-ocaml
shell: in-debian-chroot.sh {0}
run: etc/ci/github-actions-docker-make.sh package-standalone-ocaml
- name: upload standalone files
uses: actions/upload-artifact@v3
with:
name: standalone-${{ matrix.env.DEBIAN }}
path: standalone.tar.gz
- name: upload OCaml files
uses: actions/upload-artifact@v3
with:
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/coq-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ jobs:
eval $(opam env)
etc/ci/github-actions-make.sh -j2 all
- name: package standalone files
run: |
eval $(opam env)
etc/ci/github-actions-make.sh package-standalone-ocaml
- name: only-test-amd64-files-lite
run: |
eval $(opam env)
Expand All @@ -71,6 +76,11 @@ jobs:
with:
name: ExtractionOCaml
path: src/ExtractionOCaml
- name: upload standalone files
uses: actions/upload-artifact@v3
with:
name: standalone-macos
path: standalone.tar.gz
- name: display timing info
run: cat time-of-build-pretty.log
- name: display per-line timing info
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/coq-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ jobs:
run: |
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh -j${NJOBS} standalone-ocaml'
shell: cmd
- name: package-standalone-ocaml
run: |
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh package-standalone-ocaml'
shell: cmd
- name: coq
run: |
%CYGWIN_ROOT%\bin\bash.exe -l -c 'cd "%cd%"; opam exec -- etc/ci/github-actions-make.sh -j1 coq'
Expand All @@ -89,6 +93,11 @@ jobs:
with:
name: ExtractionOCaml
path: src/ExtractionOCaml
- name: upload standalone files
uses: actions/upload-artifact@v3
with:
name: standalone-windows
path: standalone.tar.gz
- name: display timing info
run: type time-of-build-pretty.log
shell: cmd
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/docker-coq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@ jobs:
name: generated-files-${{ matrix.env.COQ_VERSION }}
path: generated-files.tgz
if: ${{ failure() }}
- name: package-standalone-ocaml
run: etc/ci/github-actions-docker-make.sh -f Makefile.standalone package-standalone-ocaml
- name: upload standalone files
uses: actions/upload-artifact@v3
with:
name: standalone-docker-coq-${{ matrix.env.DOCKER_COQ_VERSION }}
path: standalone.tar.gz
- name: upload OCaml files
uses: actions/upload-artifact@v3
with:
Expand Down
17 changes: 17 additions & 0 deletions Makefile.standalone
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# files on .v files, so that we can compile them by invoking this
# makefile directly even when Coq is not available

SELF := $(lastword $(MAKEFILE_LIST))

include Makefile.config

GHC?=ghc
Expand All @@ -19,13 +21,18 @@ CAMLOPT_PERF ?= $(OCAMLOPTP)
CAMLOPT_PERF_SHOW:=OCAMLOPTP
endif

PACKAGE ?= standalone.tar.gz
PACKAGE_CMD ?= tar --transform 's,.*/,,g' -czvf
PACKAGE_CMD_FUNC ?= $(PACKAGE_CMD) $(1) $(2)

ENSURE_STACK_LIMIT := . etc/ensure_stack_limit.sh || true

.PHONY: \
perf-standalone \
standalone install-standalone uninstall-standalone \
standalone-ocaml install-standalone-ocaml uninstall-standalone-ocaml \
standalone-haskell install-standalone-haskell uninstall-standalone-haskell \
package-standalone package-standalone-ocaml package-standalone-haskell \
#

# pass -w -20 to disable the unused argument warning
Expand Down Expand Up @@ -93,3 +100,13 @@ uninstall-standalone-ocaml uninstall-standalone-haskell:

install-standalone: install-standalone-ocaml # install-standalone-haskell
uninstall-standalone: uninstall-standalone-ocaml # uninstall-standalone-haskell

package-standalone: package-standalone-ocaml # package-standalone-haskell

package-standalone-ocaml package-standalone-haskell : package-standalone-% :
$(SHOW)'PACKAGE STANDALONE $*'
$(HIDE)rm -f "$(PACKAGE)"
+$(HIDE)standalonedir="$$(mktemp -d "$$(pwd)/standalone-tmp.XXXXX")"; \
$(MAKE) -f $(SELF) install-standalone-$* BINDIR="$$standalonedir" && \
$(call PACKAGE_CMD_FUNC,$(PACKAGE),"$$standalonedir/"*) && \
rm -rf "$$standalonedir"

0 comments on commit b1fe2db

Please sign in to comment.