generated from IWANABETHATGUY/tower-lsp-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
81 additions
and
78 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: Release LSP | ||
|
||
permissions: | ||
contents: write | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" # Triggers on version tags (e.g., v1.0.0) | ||
workflow_dispatch: # Allows manual runs | ||
|
||
jobs: | ||
build: | ||
name: Build Native LSP Binary | ||
runs-on: ${{ matrix.platform }} | ||
|
||
strategy: | ||
matrix: | ||
platform: [ubuntu-latest, macos-latest, windows-latest] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
|
||
- name: Cache Cargo dependencies | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Build LSP Binary | ||
run: cargo build --release -p lsp-bin | ||
|
||
- name: Rename binary for release | ||
shell: bash | ||
run: | | ||
mkdir -p release | ||
if [[ "$RUNNER_OS" == "Linux" ]]; then | ||
cp target/release/lsp-bin release/lsp_bin-linux-x86_64 | ||
elif [[ "$RUNNER_OS" == "macOS" ]]; then | ||
cp target/release/lsp-bin release/lsp_bin-macos-x86_64 | ||
elif [[ "$RUNNER_OS" == "Windows" ]]; then | ||
cp target/release/lsp-bin.exe release/lsp_bin-windows-x86_64.exe | ||
fi | ||
- name: Upload Native Binary | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: lsp_bin-${{ runner.os }}-x86_64 | ||
path: release/* | ||
|
||
create-release: | ||
name: Create GitHub Release | ||
runs-on: ubuntu-latest | ||
needs: [build] | ||
|
||
permissions: | ||
actions: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Download all artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: release | ||
|
||
- name: List downloaded files | ||
run: ls -R release | ||
|
||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
release/* | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag_name: ${{ github.ref_name }} | ||
name: Release ${{ github.ref_name }} | ||
body: "🚀 New release of LSP! Includes native binaries for Linux, macOS and Windows." | ||
|