Skip to content

Commit

Permalink
chore: github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
江鹏飞 committed Jul 22, 2023
1 parent 96a2241 commit 4b96a3a
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Go

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19

- name: Test
run: go test -v ./...

- name: Build with xgo
uses: crazy-max/ghaction-xgo@v2
with:
xgo_version: latest
go_version: ${{ matrix.go_version }}
dest: build
prefix: thriftls
targets: windows/386,windows/amd64,linux/386,linux/amd64,darwin/386,darwin/amd64
v: true
x: false
race: false
ldflags: -s -w
buildmode: default

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
files: |
build/thriftls*
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: "tagged-release"

on:
push:
tags:
- "v*"

jobs:
tagged-release:
name: "Tagged Release"
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19

- name: Test
run: go test -v ./...

- name: Build with xgo
uses: crazy-max/ghaction-xgo@v2
with:
xgo_version: latest
go_version: ${{ matrix.go_version }}
dest: build
prefix: kubecm
targets: windows/386,windows/amd64,linux/386,linux/amd64,darwin/386,darwin/amd64
v: true
x: false
race: false
ldflags: -s -w
buildmode: default

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: |
build/thriftls*
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# thrift language server

[![Language grade: Go](https://img.shields.io/lgtm/grade/go/g/joyme123/thrift-ls.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/joyme123/thrift-ls/context:go)

![Go](https://github.com/joyme123/thrift-ls/workflows/Go/badge.svg?branch=main)

## 调试

这里以 neovim 为例,在配置文件里用 lua 进行设置:
Expand Down

0 comments on commit 4b96a3a

Please sign in to comment.