git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Windows CI
4a1a779Harry Garrood
appveyor.ymlnew file+59
@@ -0,0 +1,59 @@
1+platform: x64
2+version: '{build}'
3+environment:
4+ GITHUB_TOKEN:
5+ secure: PUrCLwiP1G73fP5hr5HVpwBQU6n6t0A7CtfQxrFRAlTC+fnkntcA+9TR58OTEy7y
6+ # Keep the path as short as possible, just in case.
7+ STACK_ROOT: c:\s
8+ # Appveyor does not seem to be able to cope with the symbolic link
9+ # stack.yaml, so this is a workaround.
10+ STACK_YAML: stack-lts-5.yaml
11+ RELEASE_USER: purescript
12+ RELEASE_REPO: purescript
13+cache:
14+- c:\s
15+install:
16+- git submodule update --init
17+- ps: Install-Product node 5
18+- npm install -g bower
19+
20+- ps: |
21+ New-Item -ItemType Directory -Force -Path C:\tools
22+ $env:Path += ";C:\tools"
23+ (New-Object Net.WebClient).DownloadFile('https://www.stackage.org/stack/windows-x86_64', 'c:\tools\stack.zip')
24+ pushd c:\tools
25+ 7z x c:\tools\stack.zip stack.exe
26+ popd
27+
28+- stack --no-terminal --verbosity=error setup 1>stack-setup.log 2>&1 || type stack-setup.log
29+
30+build_script:
31+# Override the default build script.
32+- echo ""
33+test_script:
34+- stack -j1 --no-terminal test --pedantic
35+on_success:
36+# this seems to be necessary; if omitted, the bash script fails to find the
37+# tool 'strip'.
38+- copy C:\MinGW\bin\strip.exe C:\tools\strip.exe
39+- ps: |
40+ function UploadFile
41+ {
42+ github-release upload --user $env:RELEASE_USER --repo $env:RELEASE_REPO --tag $env:APPVEYOR_REPO_TAG_NAME --file $args[0] --name $args[0]
43+ }
44+
45+ if ($env:APPVEYOR_REPO_TAG_NAME)
46+ {
47+ bash ./bundle/build-stack.sh win64
48+
49+ (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')
50+ pushd c:\tools
51+ 7z x github-release.zip bin/windows/amd64/github-release.exe
52+ Copy-Item bin/windows/amd64/github-release.exe github-release.exe
53+ popd
54+
55+ pushd bundle
56+ UploadFile win64.tar.gz
57+ UploadFile win64.sha
58+ popd
59+ }
bundle/build-stack.sh+41−28
@@ -1,7 +1,8 @@
1+## This script can be run on any supported OS to create a binary .tar.gz
2+## bundle.
3+## For Windows, msysgit contains all of the pieces needed to run this script.
1set -e
4set -e
2
5
3−SCRIPTPATH=$( cd "$(dirname "$0")" ; pwd -P )
4−
5OS=$1
6OS=$1
6
7
7if [ -z $OS ]
8if [ -z $OS ]
@@ -10,39 +11,51 @@ then
10 exit 1
11 exit 1
11fi
12fi
12
13
13−pushd ${SCRIPTPATH} > /dev/null
14+pushd $(stack path --project-root)
15+
16+LOCAL_INSTALL_ROOT=$(stack path --local-install-root)
17+
18+if [ "$OS" = "win64" ]
19+then
20+ BIN_EXT=".exe"
21+else
22+ BIN_EXT=""
23+fi
14
24
15# Make the staging directory
25# Make the staging directory
16−mkdir -p build/purescript/
26+mkdir -p bundle/build/purescript
17−
27+
18−# Strip the binaries
28+# Strip the binaries, and copy them to the staging directory
19−strip ~/.local/bin/psc
29+for BIN in psc psci psc-docs psc-publish psc-bundle psc-ide-server psc-ide-client
20−strip ~/.local/bin/psci
30+do
21−strip ~/.local/bin/psc-docs
31+ FULL_BIN="$LOCAL_INSTALL_ROOT/bin/${BIN}${BIN_EXT}"
22−strip ~/.local/bin/psc-publish
32+ strip "$FULL_BIN" || true # not the end of the world if this fails, and
23−strip ~/.local/bin/psc-bundle
33+ # AppVeyor can't seem to handle it for some reason
24−strip ~/.local/bin/psc-ide-server
34+ cp "$FULL_BIN" bundle/build/purescript
25−strip ~/.local/bin/psc-ide-client
35+done
26−
36+
27−# Copy files to staging directory
37+# Copy extra files to the staging directory
28−cp ~/.local/bin/psc build/purescript/
29−cp ~/.local/bin/psci build/purescript/
30−cp ~/.local/bin/psc-docs build/purescript/
31−cp ~/.local/bin/psc-publish build/purescript/
32−cp ~/.local/bin/psc-bundle build/purescript/
33−cp ~/.local/bin/psc-ide-server build/purescript/
34−cp ~/.local/bin/psc-ide-client build/purescript/
35−cp README build/purescript/
38+cp bundle/README bundle/build/purescript/
36−cp ../LICENSE build/purescript/
39+cp LICENSE bundle/build/purescript/
37−cp ../INSTALL.md build/purescript/
40+cp INSTALL.md bundle/build/purescript/
41+
42+stack list-dependencies >bundle/build/purescript/dependencies.txt
38
43
39# Make the binary bundle
44# Make the binary bundle
40−pushd build > /dev/null
45+pushd bundle/build > /dev/null
41−tar -zcvf ../$OS.tar.gz purescript
46+tar -zcvf ../${OS}.tar.gz purescript
42popd > /dev/null
47popd > /dev/null
43
48
44# Calculate the SHA hash
49# Calculate the SHA hash
50+if [ "$OS" = "win64" ]
51+then
52+ # msys/mingw does not include shasum. :(
53+ SHASUM="openssl dgst -sha1"
54+else
55+ SHASUM="shasum"
56+fi
57+
45−shasum $OS.tar.gz > $OS.sha
58+$SHASUM bundle/${OS}.tar.gz > bundle/${OS}.sha
46
59
47# Remove the staging directory
60# Remove the staging directory
48rm -rf build/
61rm -rf build/
bundle/build.shdeleted−50
@@ -1,50 +0,0 @@
1−set -e
2−
3−SCRIPTPATH=$( cd "$(dirname "$0")" ; pwd -P )
4−
5−OS=$1
6−
7−if [ -z $OS ]
8−then
9− echo "Usage: build.sh osname"
10− exit 1
11−fi
12−
13−pushd ${SCRIPTPATH} > /dev/null
14−
15−# Make the staging directory
16−mkdir -p build/purescript/
17−
18−# Strip the binaries
19−strip ../dist/build/psc/psc
20−strip ../dist/build/psci/psci
21−strip ../dist/build/psc-docs/psc-docs
22−strip ../dist/build/psc-publish/psc-publish
23−strip ../dist/build/psc-bundle/psc-bundle
24−strip ../dist/build/psc-ide-server/psc-ide-server
25−strip ../dist/build/psc-ide-client/psc-ide-client
26−
27−# Copy files to staging directory
28−cp ../dist/build/psc/psc build/purescript/
29−cp ../dist/build/psci/psci build/purescript/
30−cp ../dist/build/psc-docs/psc-docs build/purescript/
31−cp ../dist/build/psc-publish/psc-publish build/purescript/
32−cp ../dist/build/psc-bundle/psc-bundle build/purescript/
33−cp ../dist/build/psc-ide-server/psc-ide-server build/purescript/
34−cp ../dist/build/psc-ide-client/psc-ide-client build/purescript/
35−cp README build/purescript/
36−cp ../LICENSE build/purescript/
37−cp ../INSTALL.md build/purescript/
38−
39−# Make the binary bundle
40−pushd build > /dev/null
41−tar -zcvf ../$OS.tar.gz purescript
42−popd > /dev/null
43−
44−# Calculate the SHA hash
45−shasum $OS.tar.gz > $OS.sha
46−
47−# Remove the staging directory
48−rm -rf build/
49−
50−popd > /dev/null
bundle/winbuild-stack.shdeleted−46
@@ -1,46 +0,0 @@
1−## This Windows-specific version of build.sh can be run in an msys environment
2−## to create a .tar.gz bundle for Windows users.
3−## msysgit contains all of the pieces needed to run this script.
4−
5−set -e
6−
7−SCRIPTPATH=$( cd "$(dirname "$0")" ; pwd -P )
8−
9−pushd ${SCRIPTPATH} > /dev/null
10−
11−# Make the staging directory
12−mkdir -p build/purescript/
13−
14−# Strip the binaries
15−strip $APPDATA/local/bin/psc.exe
16−strip $APPDATA/local/bin/psci.exe
17−strip $APPDATA/local/bin/psc-docs.exe
18−strip $APPDATA/local/bin/psc-publish.exe
19−strip $APPDATA/local/bin/psc-bundle.exe
20−strip $APPDATA/local/bin/psc-ide-server.exe
21−strip $APPDATA/local/bin/psc-ide-client.exe
22−
23−# Copy files to staging directory
24−cp $APPDATA/local/bin/psc.exe build/purescript/
25−cp $APPDATA/local/bin/psci.exe build/purescript/
26−cp $APPDATA/local/bin/psc-docs.exe build/purescript/
27−cp $APPDATA/local/bin/psc-publish.exe build/purescript/
28−cp $APPDATA/local/bin/psc-bundle.exe build/purescript/
29−cp $APPDATA/local/bin/psc-ide-server.exe build/purescript/
30−cp $APPDATA/local/bin/psc-ide-client.exe build/purescript/
31−cp README build/purescript/
32−cp ../LICENSE build/purescript/
33−cp ../INSTALL.md build/purescript/
34−
35−# Make the binary bundle
36−pushd build > /dev/null
37−tar -zcvf ../win64.tar.gz purescript
38−popd > /dev/null
39−
40−# Calculate the MD5 hash
41−md5sum win64.tar.gz > win64.md5
42−
43−# Remove the staging directory
44−rm -rf build/
45−
46−popd > /dev/null
bundle/winbuild.shdeleted−47
@@ -1,47 +0,0 @@
1−## This Windows-specific version of build.sh can be run in an msys environment
2−## to create a .tar.gz bundle for Windows users.
3−## msysgit contains all of the pieces needed to run this script.
4−
5−set -e
6−
7−SCRIPTPATH=$( cd "$(dirname "$0")" ; pwd -P )
8−
9−pushd ${SCRIPTPATH}
10−
11−# Make the staging directory
12−mkdir -p build/purescript/
13−
14−# Strip the binaries
15−strip ../dist/build/psc/psc.exe
16−strip ../dist/build/psci/psci.exe
17−strip ../dist/build/psc-docs/psc-docs.exe
18−strip ../dist/build/psc-publish/psc-publish.exe
19−strip ../dist/build/psc-bundle/psc-bundle.exe
20−strip ../dist/build/psc-ide-server/psc-ide-server.exe
21−strip ../dist/build/psc-ide-client/psc-ide-client.exe
22−
23−# Copy files to staging directory
24−cp ../dist/build/psc/psc.exe build/purescript/
25−cp ../dist/build/psci/psci.exe build/purescript/
26−cp ../dist/build/psc-docs/psc-docs.exe build/purescript/
27−cp ../dist/build/psc-publish/psc-publish.exe build/purescript/
28−cp ../dist/build/psc-bundle/psc-bundle.exe build/purescript/
29−cp ../dist/build/psc-ide-server/psc-ide-server.exe build/purescript/
30−cp ../dist/build/psc-ide-client/psc-ide-client.exe build/purescript/
31−cp README build/purescript/
32−cp ../LICENSE build/purescript/
33−cp ../INSTALL.md build/purescript/
34−
35−# Make the binary bundle
36−pushd build
37−tar -zcvf ../win64.tar.gz purescript
38−popd
39−
40−# Calculate the MD5 hash
41−md5sum win64.tar.gz > win64.md5
42−
43−# Remove the staging directory
44−rm -rf build/
45−
46−popd
47−