-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (64 loc) · 2.44 KB
/
Copy pathrelease.yml
File metadata and controls
82 lines (64 loc) · 2.44 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
env:
KOKA_VERSION: 3.2.2
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache Koka setup
id: cache-koka
uses: actions/cache@v4
with:
key: koka-setup-${{ env.KOKA_VERSION }}
path: |
./koka-compiler
- name: Setup Koka
if: steps.cache-koka.outputs.cache-hit != 'true'
run: |
curl -sSL https://github.com/koka-lang/koka/releases/download/v${{ env.KOKA_VERSION }}/install.sh > install-koka.sh
sudo sh install-koka.sh -- --prefix=$PWD/koka-compiler
- name: Setup Koka path
run: |
echo "$PWD/koka-compiler/bin" >> $GITHUB_PATH
# I don't want to create package.json or yarn.lock to support actions/setup-node
- name: Cache JS minifier
id: cache-js-minify
uses: actions/cache@v4
with:
key: js-minifier
path: |
./node_modules
- name: Setup JS minifier
if: steps.cache-js-minify.outputs.cache-hit != 'true'
run: |
npm install --save-dev rollup @rollup/plugin-terser
- name: Build
run: |
./install_libs.sh
mkdir -p build
SOURCES="-i./src/ -i./libs/"
CCLIBS="--cclibdir=$(dirname $(g++ --print-file-name=libstdc++.a)) --cclibdir=$(dirname $(g++ --print-file-name=libicuuc.a))"
tests_output=$( koka $SOURCES $CCLIBS -v0 -e libs/std/test/detect.kk -- -v0 $SOURCES $CCLIBS )
# workaround for https://github.com/koka-lang/koka/issues/797
printf '%s\n' "${tests_output}"
echo ${tests_output} | grep -qvi "failed"
koka -c src/extractor/extract.kk $SOURCES $CCLIBS --target=c -O3 \
--ccopts="-ffunction-sections -fdata-sections -fomit-frame-pointer" --cclinkopts="-Wl,--gc-sections,-s" \
-obuild/indexer
chmod +x build/indexer
koka -c src/frontend/search.kk $SOURCES --target=js -O3
npx rollup .koka/*/js-drelease*/frontend_search__main.mjs --file build/search.min.mjs --format esm --plugin @rollup/plugin-terser
tar -czvf build/release.tar.gz -C build indexer search.min.mjs
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
build/release.tar.gz