Skip to content

Commit 8547588

Browse files
committed
add github workflow and goreleaser
1 parent 173a646 commit 8547588

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

.github/workflows/go.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
goreleaser:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
with:
18+
fetch-depth: 0
19+
- name: Set up Go
20+
uses: actions/setup-go@v4
21+
with:
22+
go-version: '1.20'
23+
- name: Run GoReleaser
24+
uses: goreleaser/goreleaser-action@v4
25+
with:
26+
distribution: goreleaser
27+
version: latest
28+
args: release --clean
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}

.goreleaser.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
before:
4+
hooks:
5+
# You may remove this if you don't use go modules.
6+
- go mod tidy
7+
builds:
8+
- env:
9+
- CGO_ENABLED=0
10+
goos:
11+
- linux
12+
- windows
13+
- darwin
14+
goarch:
15+
- amd64
16+
- arm64
17+
flags:
18+
- -v
19+
- -trimpath
20+
ldflags:
21+
- -s
22+
- -w
23+
24+
archives:
25+
- format: tar.gz
26+
# this name template makes the OS and Arch compatible with the results of uname.
27+
name_template: >-
28+
{{ .ProjectName }}_
29+
{{- title .Os }}_
30+
{{- if eq .Arch "amd64" }}x86_64
31+
{{- else if eq .Arch "386" }}i386
32+
{{- else }}{{ .Arch }}{{ end }}
33+
{{- if .Arm }}v{{ .Arm }}{{ end }}
34+
# use zip for windows archives
35+
format_overrides:
36+
- goos: windows
37+
format: zip
38+
checksum:
39+
name_template: 'checksums.txt'
40+
snapshot:
41+
name_template: "{{ incpatch .Version }}-next"
42+
changelog:
43+
sort: asc
44+
filters:
45+
exclude:
46+
- '^docs:'
47+
- '^test:'
48+
49+
# The lines beneath this are called `modelines`. See `:help modeline`
50+
# Feel free to remove those if you don't want/use them.
51+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
52+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
53+
54+
brews:
55+
- tap:
56+
owner: quantonganh
57+
name: homebrew-tap
58+
homepage: https://github.com/quantonganh/snippets-ls
59+
description: >-
60+
A simple language server to just insert snippets into Helix.
61+
license: MIT

0 commit comments

Comments
 (0)