forked from koka-lang/koka
-
Notifications
You must be signed in to change notification settings - Fork 0
118 lines (102 loc) · 3.92 KB
/
bundle.yaml
File metadata and controls
118 lines (102 loc) · 3.92 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
on:
workflow_dispatch: # so we can run the workflow manually as well
push:
branches:
- dev
tags:
- 'v*'
pull_request:
branches:
- dev
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true # Cancel any in-progress runs of this workflow when a new run is triggered on the same ref (branch or tag)
permissions:
contents: write
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
name: bundle
jobs:
build:
name: Bundle Koka
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macOS 15 is latest for x64, default now is arm64
# we build on the oldest ubuntu version for better binary compatibility.
os: [windows-latest, macOS-latest, macos-15-intel, ubuntu-22.04, ubuntu-22.04-arm]
steps:
# Checkout: https://github.com/actions/checkout
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: true
# Cache setup for vcpkg (https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache)
# https://github.com/actions/github-script
- name: Setup vcpkg cache
uses: actions/github-script@v8
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
# Use a VS shell on Windows (so `cl` is on the PATH): https://github.com/egor-tensin/vs-shell (MIT license)
- name: Set up Visual Studio shell (Windows x64)
uses: egor-tensin/vs-shell@v2
if: runner.os == 'Windows' && runner.arch == 'X64'
with:
arch: x64
# Set up stack and cache dependencies: https://github.com/freckle/stack-action (MIT license)
- name: Build compiler
uses: freckle/stack-action@v5
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
with:
test: false
stack-build-arguments: ""
cache-save-always: true
# Set VCPKG_ROOT on Windows (otherwise it points to the wrong one in the VS install)
- name: Set VCPKG_ROOT (Windows)
if: runner.os == 'Windows'
run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> $env:GITHUB_ENV
# Run tests
- name: Run test suite
if: runner.os != 'macOS'
run: |
stack test
- name: Run test suite (macOS)
if: runner.os == 'macOS'
env:
LC_ALL: C
run: |
stack test
# Bundle
- name: Build libraries
if: startsWith(github.ref, 'refs/tags/') # only bundle if tagged with a version
run: |
stack exec koka -- -e -O2 util/bundle
# VS code extension
- name: Package VS code extension (Windows x64)
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'Windows' && runner.arch == 'X64' # only build extension if tagged with a version
working-directory: support/vscode/koka.language-koka
run: |
npm install
npm run build
# Create a release: https://github.com/softprops/action-gh-release (MIT license)
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') # only release if tagged with a version
with:
files: |
bundle/**/*.tar.gz
support/vscode/koka.language-koka/*.vsix
util/install.bat
draft: true
body_path: util/release.md
- name: Release install scripts
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux' && runner.arch == 'X64' # only release if tagged with a version
with:
files: | # Only add install file on Linux to avoid line ending issues: https://github.com/koka-lang/koka/issues/742
util/install.sh
draft: true
body_path: util/release.md