Skip to content

Commit 5bbb040

Browse files
committed
Github Workflow
1 parent 9f400dd commit 5bbb040

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

.github/workflows/build.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
on:
2+
push:
3+
tags:
4+
- 'v*'
5+
6+
permissions:
7+
contents: write
8+
9+
env:
10+
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
11+
12+
name: build
13+
jobs:
14+
build:
15+
name: Build Koka
16+
runs-on: ${{ matrix.os }}
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest, macOS-latest]
20+
steps:
21+
- uses: actions/checkout@v4
22+
with:
23+
submodules: true
24+
25+
# Set up stack and cache dependencies: https://github.com/freckle/stack-action
26+
- uses: freckle/stack-action@v5
27+
with:
28+
test: false
29+
stack-build-arguments: ""
30+
cache-save-always: true
31+
32+
- name: Build
33+
run: stack build
34+
35+
# Cache setup for vcpkg (https://learn.microsoft.com/en-us/vcpkg/consume/binary-caching-github-actions-cache)
36+
- name: Export GitHub Actions cache environment variables
37+
uses: actions/github-script@v7
38+
with:
39+
script: |
40+
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
41+
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
42+
43+
- name: Run Koka Packaging
44+
run: |
45+
stack exec koka -- -e -O2 util/bundle
46+
47+
- name: Package VSCode Extension
48+
working-directory: support/vscode/koka.language-koka
49+
run: |
50+
npm install
51+
npm run build
52+
npm run package
53+
54+
# Create a release https://github.com/softprops/action-gh-release
55+
- name: Release
56+
uses: softprops/action-gh-release@v2
57+
with:
58+
files: |
59+
bundle/**/*.tar.gz
60+
support/vscode/koka.language-koka/*.vsix
61+
make_latest: true

0 commit comments

Comments
 (0)