-
-
Notifications
You must be signed in to change notification settings - Fork 16
56 lines (46 loc) · 1.36 KB
/
release.yml
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
name: release
on:
push:
tags:
- "v*"
jobs:
build-release:
name: build-release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Node
uses: actions/setup-node@v4
- name: Install npm dependencies
run: npm ci
- name: Ensure generated parser files are up to date
run: npx tree-sitter generate
- name: Ensure tests pass
run: npx tree-sitter test
- name: Compile library file
run: cc -shared -fPIC -g -O2 -I src src/parser.c src/scanner.c -o tree-sitter-gleam.so
- name: Create archive
run: |
VERSION="${GITHUB_REF#refs/tags/}"
case ${{ matrix.os }} in
"ubuntu-latest") FAMILY="linux";;
"macos-latest") FAMILY="macos";;
esac
ARCHIVE="tree-sitter-gleam-$VERSION-$FAMILY.tar.gz"
tar -czf $ARCHIVE tree-sitter-gleam.so
echo "ASSET=$ARCHIVE" >> $GITHUB_ENV
- name: Upload release archive
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
prerelease: false
fail_on_unmatched_files: true
files: |
${{ env.ASSET }}