Skip to content

Commit

Permalink
Build distribution tarballs with and without solvers (#1228)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron Tomb authored Jul 23, 2021
1 parent e78195a commit 17f5dc7
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 9 deletions.
18 changes: 15 additions & 3 deletions .github/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -xEeuo pipefail

[[ "$RUNNER_OS" == 'Windows' ]] && IS_WIN=true || IS_WIN=false
BIN=bin
BIN=${PWD}/bin
EXT=""
$IS_WIN && EXT=".exe"
mkdir -p "$BIN"
Expand Down Expand Up @@ -118,8 +118,8 @@ install_system_deps() {
install_cvc4 &
install_yices &
wait
export PATH=$PWD/$BIN:$PATH
echo "$PWD/$BIN" >> "$GITHUB_PATH"
export PATH=$BIN:$PATH
echo "$BIN" >> "$GITHUB_PATH"
is_exe "$BIN" z3 && is_exe "$BIN" cvc4 && is_exe "$BIN" yices
}

Expand Down Expand Up @@ -165,6 +165,18 @@ zip_dist() {
tar -cvzf "$name".tar.gz "$name"
}

zip_dist_with_solvers() {
: "${VERSION?VERSION is required as an environment variable}"
name="${name:-"cryptol-$VERSION-$RUNNER_OS-x86_64"}"
sname="${name}-with-solvers"
cp "$(which cvc4)" dist/bin/
cp "$(which yices)" dist/bin/
cp "$(which yices-smt2)" dist/bin/
cp "$(which z3)" dist/bin/
cp -r dist "$sname"
tar -cvzf "$sname".tar.gz "$sname"
}

output() { echo "::set-output name=$1::$2"; }
ver() { grep Version cryptol.cabal | awk '{print $2}'; }
set_version() { output cryptol-version "$(ver)"; }
Expand Down
27 changes: 21 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,26 @@ jobs:
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
run: .github/ci.sh sign cryptol.msi

- shell: bash
run: |
NAME="${{ needs.config.outputs.name }}-${{ runner.os }}-x86_64"
echo "NAME=$NAME" >> $GITHUB_ENV
.github/ci.sh zip_dist $NAME
- shell: bash
run: |
NAME="${{ needs.config.outputs.name }}-${{ runner.os }}-x86_64"
echo "NAME=$NAME" >> $GITHUB_ENV
.github/ci.sh zip_dist_with_solvers $NAME
- if: needs.config.outputs.release == 'true'
shell: bash
env:
SIGNING_PASSPHRASE: ${{ secrets.SIGNING_PASSPHRASE }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
run: .github/ci.sh sign ${NAME}.tar.gz

- shell: bash
run: |
NAME="${{ needs.config.outputs.name }}-${{ runner.os }}-x86_64"
echo "NAME=$NAME" >> $GITHUB_ENV
.github/ci.sh zip_dist $NAME
.github/ci.sh sign ${NAME}.tar.gz
.github/ci.sh sign ${NAME}-with-solvers.tar.gz
- uses: actions/upload-artifact@v2
with:
Expand All @@ -169,6 +177,13 @@ jobs:
if-no-files-found: error
retention-days: ${{ needs.config.outputs.retention-days }}

- uses: actions/upload-artifact@v2
with:
name: ${{ env.NAME }}-with-solvers
path: "${{ env.NAME }}-with-solvers.tar.gz*"
if-no-files-found: error
retention-days: ${{ needs.config.outputs.retention-days }}

- if: matrix.ghc-version == '8.6.5'
uses: actions/upload-artifact@v2
with:
Expand Down

0 comments on commit 17f5dc7

Please sign in to comment.