Skip to content

Commit

Permalink
ci: add ability to release via ci
Browse files Browse the repository at this point in the history
  • Loading branch information
xcb-xwii committed Apr 20, 2024
1 parent ee6088f commit a0f83af
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: Build
on:
push:
branches: [master]
workflow_call:

jobs:
windows-x86_64:
Expand Down Expand Up @@ -33,12 +34,12 @@ jobs:
- name: Build
run: >-
sh make.sh lua_tree_sitter.dll ${{ matrix.editor.make_opts }} &&
mv lua-tree-sitter/lua_tree_sitter.dll init.dll
mv lua-tree-sitter/lua_tree_sitter.dll ${{ matrix.editor.name }}-tree-sitter.x86_64-windows.dll
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.editor.name }}-tree-sitter-x86_64-windows
path: init.dll
name: ${{ matrix.editor.name }}-tree-sitter.x86_64-windows
path: ${{ matrix.editor.name }}-tree-sitter.x86_64-windows.dll
if-no-files-found: error

linux:
Expand All @@ -64,16 +65,16 @@ jobs:
with:
submodules: recursive
- name: Install cc
run: sudo apt-get -y update && sudo apt-get -y upgrade && sudo apt-get install make ${{ matrix.arch.cc }}
run: sudo apt-get -y update && sudo apt-get -y upgrade && sudo apt-get install make ${{ matrix.arch.pkg }}
- name: Build
run: >-
sh make.sh lua_tree_sitter.so CC=${{ matrix.arch.cc }} ${{ matrix.editor.make_opts }} &&
mv lua-tree-sitter/lua_tree_sitter.so init.so
mv lua-tree-sitter/lua_tree_sitter.so ${{ matrix.editor.name }}-tree-sitter.${{ matrix.arch.name }}-linux.so
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.editor.name }}-tree-sitter-${{ matrix.arch.name }}-linux
path: init.so
name: ${{ matrix.editor.name }}-tree-sitter.${{ matrix.arch.name }}-linux
path: ${{ matrix.editor.name }}-tree-sitter.${{ matrix.arch.name }}-linux.so
if-no-files-found: error

macos:
Expand All @@ -99,10 +100,10 @@ jobs:
- name: Build
run: >-
bash make.sh lua_tree_sitter.so ${{ matrix.arch.make_opts }} ${{ matrix.editor.make_opts }} &&
mv lua-tree-sitter/lua_tree_sitter.so init.so
mv lua-tree-sitter/lua_tree_sitter.so ${{ matrix.editor.name }}-tree-sitter.${{ matrix.arch.name }}-darwin.so
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.editor.name }}-tree-sitter-${{ matrix.arch.name }}-darwin
path: init.so
name: ${{ matrix.editor.name }}-tree-sitter.${{ matrix.arch.name }}-darwin
path: ${{ matrix.editor.name }}-tree-sitter.${{ matrix.arch.name }}-darwin.so
if-no-files-found: error
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on:
workflow_dispatch:
inputs:
tag:
description: Release tag
required: true
type: string

jobs:
build:
name: Build binaries
uses: ./.github/workflows/build.yml
release:
name: Upload release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Upload artifacts to release
uses: ncipollo/release-action@v1
with:
artifacts: "lite-xl-tree-sitter.*/*,pragtical-tree-sitter.*/*"
tag: ${{ inputs.tag }}
commit: master
allowUpdates: true

0 comments on commit a0f83af

Please sign in to comment.