forked from ponylang/pony-language-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_ci.sh
executable file
·42 lines (38 loc) · 1.34 KB
/
build_ci.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /bin/bash
sudo apt update && sudo apt install gcc -y
# SCRIPT
set -e
set -x
export SHELL=/bin/bash
# Linux
export PATH=/home/runner/.local/share/ponyup/bin:$PATH
# MacOS
export PATH=/Users/runner/.local/share/ponyup/bin:$PATH
sh -c "$(curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ponylang/ponyup/latest-release/ponyup-init.sh)"
ponyup update corral release
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
git clone https://github.com/ponylang/ponyc.git ponyc-repo
cd ponyc-repo && git fetch --all --tags
for PONY_VERSION in $(git tag)
do
if [ $(version $PONY_VERSION) -ge $(version "0.54.0") ]; then
echo "Building with ponyc version: $PONY_VERSION"
ponyup update ponyc release-$PONY_VERSION
# copy stdlib to extension
git checkout tags/$PONY_VERSION
cd $GITHUB_WORKSPACE && cp -r ponyc-repo/packages client_vscode
# build pony-lsp
cd $GITHUB_WORKSPACE
corral fetch
corral run -- ponyc --bin-name pony-lsp lsp
cp pony-lsp client_vscode
# compile the extension
cd $GITHUB_WORKSPACE/client_vscode
npm i
npm i -g vsce
npm run compile
vsce package $PONY_VERSION
else
echo "Only versions greater than 0.54.0 are supported. Discarding $PONY_VERSION"
fi
done