From 365182841206557d56d904a626c7777471be2dc0 Mon Sep 17 00:00:00 2001 From: SerhiiCho Date: Sat, 3 May 2025 17:36:41 +0300 Subject: [PATCH] chore: add build.yml for github actions --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ CHANGELOG.md | 3 +++ README.md | 8 -------- cmd/build | 30 ------------------------------ 4 files changed, 33 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100755 cmd/build diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c9af61d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +name: Build and Release + +on: + push: + tags: + - "*" + +permissions: + contents: write + +jobs: + goreleaser: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: stable + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: "~> v1" + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bfd7dc..6e33676 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Release Notes +## v0.1.0 (2025-05-03) +- Added `build.yml` file for GitHub actions to build releases with all LSP binaries + ## v0.0.2 (2025-04-25) - Improved logger - Add generating `build-version` file to `bin` directory diff --git a/README.md b/README.md index c241484..9a268bb 100644 --- a/README.md +++ b/README.md @@ -5,13 +5,5 @@ go get github.com/textwire/lsp ``` -## Building -To build all the binaries for all the platforms, run the bash script: -```bash``` -./cmd/build -``` - -Don't forget to commit them since they are also a part of the repository. All the binaries are stored in the `bin` directory in the root of the project. Also update CHANGELOG.md. - ## License The Textwire LSP project is licensed under the [MIT License](LICENSE) and is free to use, modify, and distribute. diff --git a/cmd/build b/cmd/build deleted file mode 100755 index b414e96..0000000 --- a/cmd/build +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -if [[ $(git status --porcelain) ]]; then - echo "❌ Cannot build until there are no uncommitted changes" - exit 1 -fi - -echo "🏗️ Starting build process..." - -# Linux (amd64) -GOOS=linux GOARCH=amd64 go build -o bin/textwire_lsp_linux_amd64 main.go -echo "✅ Linux build completed" - -# macOS (Intel) -GOOS=darwin GOARCH=amd64 go build -o bin/textwire_lsp_darwin_amd64 main.go -echo "✅ macOS Intel build completed" - -# macOS (Apple Silicon) -GOOS=darwin GOARCH=arm64 go build -o bin/textwire_lsp_darwin_arm64 main.go -echo "✅ macOS Apple Silicon build completed" - -# Windows (amd64) -GOOS=windows GOARCH=amd64 go build -o bin/textwire_lsp_windows_amd64.exe main.go -echo "✅ Windows build completed" - -build_version=$(git rev-parse --short HEAD) -echo "$build_version" > bin/build-version -echo "✅ Build ID generated" - -echo "🏁 DONE!"