Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 12 additions & 50 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,56 +1,18 @@
name: release
name: Publish 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
permissions:
contents: write
id-token: write
attestations: write

- 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 }}
jobs:
github:
uses: tree-sitter/workflows/.github/workflows/release.yml@main
with:
generate: true
attestations: true