Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
platform: x64
version: '{build}'
environment:
# Keep the path as short as possible, just in case.
STACK_ROOT: c:\s
# Appveyor does not seem to be able to cope with the symbolic link
# stack.yaml, so this is a workaround.
STACK_YAML: stack-lts-5.yaml
RELEASE_USER: purescript
RELEASE_REPO: purescript
cache:
- c:\s
install:
- git submodule update --init
- ps: Install-Product node 5
- npm install -g bower

- ps: |
New-Item -ItemType Directory -Force -Path C:\tools
$env:Path += ";C:\tools"
(New-Object Net.WebClient).DownloadFile('https://www.stackage.org/stack/windows-x86_64', 'c:\tools\stack.zip')
pushd c:\tools
7z x c:\tools\stack.zip stack.exe
popd

- stack --no-terminal --verbosity=error setup 1>stack-setup.log 2>&1 || type stack-setup.log

build_script:
# Override the default build script.
- echo ""
test_script:
- stack -j1 --no-terminal test --pedantic
on_success:
# this seems to be necessary; if omitted, the bash script fails to find the
# tool 'strip'.
- copy C:\MinGW\bin\strip.exe C:\tools\strip.exe
- ps: |
function UploadFile
{
github-release upload --user $env:RELEASE_USER --repo $env:RELEASE_REPO --tag $env:APPVEYOR_REPO_TAG_NAME --file $args[0] --name $args[0]
}

if ($env:APPVEYOR_REPO_TAG_NAME)
{
bash ./bundle/build-stack.sh win64

(New-Object Net.WebClient).DownloadFile('https://github.com/aktau/github-release/releases/download/v0.6.2/windows-amd64-github-release.zip', 'c:\tools\github-release.zip')
pushd c:\tools
7z x github-release.zip bin/windows/amd64/github-release.exe
Copy-Item bin/windows/amd64/github-release.exe github-release.exe
popd

pushd bundle
UploadFile win64.tar.gz
UploadFile win64.sha
popd
}
69 changes: 41 additions & 28 deletions bundle/build-stack.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
## This script can be run on any supported OS to create a binary .tar.gz
## bundle.
## For Windows, msysgit contains all of the pieces needed to run this script.
set -e

SCRIPTPATH=$( cd "$(dirname "$0")" ; pwd -P )

OS=$1

if [ -z $OS ]
Expand All @@ -10,39 +11,51 @@ then
exit 1
fi

pushd ${SCRIPTPATH} > /dev/null
pushd $(stack path --project-root)

LOCAL_INSTALL_ROOT=$(stack path --local-install-root)

if [ "$OS" = "win64" ]
then
BIN_EXT=".exe"
else
BIN_EXT=""
fi

# Make the staging directory
mkdir -p build/purescript/

# Strip the binaries
strip ~/.local/bin/psc
strip ~/.local/bin/psci
strip ~/.local/bin/psc-docs
strip ~/.local/bin/psc-publish
strip ~/.local/bin/psc-bundle
strip ~/.local/bin/psc-ide-server
strip ~/.local/bin/psc-ide-client

# Copy files to staging directory
cp ~/.local/bin/psc build/purescript/
cp ~/.local/bin/psci build/purescript/
cp ~/.local/bin/psc-docs build/purescript/
cp ~/.local/bin/psc-publish build/purescript/
cp ~/.local/bin/psc-bundle build/purescript/
cp ~/.local/bin/psc-ide-server build/purescript/
cp ~/.local/bin/psc-ide-client build/purescript/
cp README build/purescript/
cp ../LICENSE build/purescript/
cp ../INSTALL.md build/purescript/
mkdir -p bundle/build/purescript

# Strip the binaries, and copy them to the staging directory
for BIN in psc psci psc-docs psc-publish psc-bundle psc-ide-server psc-ide-client
do
FULL_BIN="$LOCAL_INSTALL_ROOT/bin/${BIN}${BIN_EXT}"
strip "$FULL_BIN" || true # not the end of the world if this fails, and
# AppVeyor can't seem to handle it for some reason
cp "$FULL_BIN" bundle/build/purescript
done

# Copy extra files to the staging directory
cp bundle/README bundle/build/purescript/
cp LICENSE bundle/build/purescript/
cp INSTALL.md bundle/build/purescript/

stack list-dependencies >bundle/build/purescript/dependencies.txt

# Make the binary bundle
pushd build > /dev/null
tar -zcvf ../$OS.tar.gz purescript
pushd bundle/build > /dev/null
tar -zcvf ../${OS}.tar.gz purescript
popd > /dev/null

# Calculate the SHA hash
shasum $OS.tar.gz > $OS.sha
if [ "$OS" = "win64" ]
then
# msys/mingw does not include shasum. :(
SHASUM="openssl dgst -sha1"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah cool, I wondered how you'd "fixed" that.

else
SHASUM="shasum"
fi

$SHASUM bundle/${OS}.tar.gz > bundle/${OS}.sha

# Remove the staging directory
rm -rf build/
Expand Down
50 changes: 0 additions & 50 deletions bundle/build.sh

This file was deleted.

46 changes: 0 additions & 46 deletions bundle/winbuild-stack.sh

This file was deleted.

47 changes: 0 additions & 47 deletions bundle/winbuild.sh

This file was deleted.