Skip to content

Commit 26246f1

Browse files
author
shuheiktgw
committed
Set up goreleaser and update the release workflow
1 parent f9ab390 commit 26246f1

File tree

3 files changed

+85
-1
lines changed

3 files changed

+85
-1
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
tags:
55
- "v*.*.*"
66

7+
permissions:
8+
contents: write
9+
710
jobs:
811
publish:
912
name: release vscode extension
@@ -16,7 +19,9 @@ jobs:
1619
sudo npm -g install n
1720
sudo n stable
1821
- name: checkout
19-
uses: actions/checkout@v3
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
2025
- uses: actions/setup-go@v4
2126
with:
2227
go-version: '1.21'
@@ -33,6 +38,18 @@ jobs:
3338
run: |
3439
mkdir assets
3540
mv ./lsp/client/vscode/grpc-federation-*.vsix assets/
41+
- name: run GoReleaser
42+
uses: goreleaser/goreleaser-action@v5
43+
with:
44+
distribution: goreleaser
45+
version: latest
46+
args: release --skip-publish --clean
47+
- name: move built extension to publish directory
48+
run: |
49+
mkdir assets
50+
mv ./dist/grpc-federation_*_checksums.txt assets/
51+
mv ./dist/grpc-federation_*_*_*.tar.gz assets/
52+
mv ./dist/grpc-federation_*_*_*.zip assets/
3653
- name: release
3754
uses: softprops/action-gh-release@v1
3855
with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@
1616

1717
.DS_Store
1818
bin
19+
20+
dist/

.goreleaser.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This is an example .goreleaser.yml file with some sensible defaults.
2+
# Make sure to check the documentation at https://goreleaser.com
3+
4+
# The lines bellow are called `modelines`. See `:help modeline`
5+
# Feel free to remove those if you don't want/need to use them.
6+
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
7+
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
8+
9+
before:
10+
hooks:
11+
# You may remove this if you don't use go modules.
12+
- go mod tidy
13+
# you may remove this if you don't need go generate
14+
- go generate ./...
15+
16+
builds:
17+
- id: grpc-federation-generator
18+
main: ./cmd/grpc-federation-generator
19+
binary: grpc-federation-generator
20+
env:
21+
- CGO_ENABLED=0
22+
goos:
23+
- linux
24+
- windows
25+
- darwin
26+
- id: grpc-federation-language-server
27+
main: ./cmd/grpc-federation-language-server
28+
binary: grpc-federation-language-server
29+
env:
30+
- CGO_ENABLED=0
31+
goos:
32+
- linux
33+
- windows
34+
- darwin
35+
- id: grpc-federation-linter
36+
main: ./cmd/grpc-federation-linter
37+
binary: grpc-federation-linter
38+
env:
39+
- CGO_ENABLED=0
40+
goos:
41+
- linux
42+
- windows
43+
- darwin
44+
- id: protoc-gen-grpc-federation
45+
main: ./cmd/protoc-gen-grpc-federation
46+
binary: protoc-gen-grpc-federation
47+
env:
48+
- CGO_ENABLED=0
49+
goos:
50+
- linux
51+
- windows
52+
- darwin
53+
54+
archives:
55+
- format: tar.gz
56+
format_overrides:
57+
- goos: windows
58+
format: zip
59+
60+
changelog:
61+
sort: asc
62+
filters:
63+
exclude:
64+
- "^docs:"
65+
- "^test:"

0 commit comments

Comments
 (0)