Skip to content

Commit

Permalink
add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ajuvercr committed Jan 30, 2025
1 parent 2f1dcc0 commit 690afde
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 78 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/ci_pages

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/main.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/pages.yml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/workflows/release.yml
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."

0 comments on commit 690afde

Please sign in to comment.