Skip to content

Commit 0b5a729

Browse files
committed
chore: Add release workflow
1 parent a736b74 commit 0b5a729

File tree

12 files changed

+120
-54
lines changed

12 files changed

+120
-54
lines changed

.github/workflows/go-releaser.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: goreleaser
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
goreleaser:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Fetch Git tags
17+
run: git fetch --force --tags
18+
19+
- name: Import GPG key
20+
id: import_gpg
21+
uses: crazy-max/ghaction-import-gpg@v6
22+
with:
23+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
24+
passphrase: ${{ secrets.PASSPHRASE }}
25+
26+
- name: Setup Go
27+
uses: actions/setup-go@v5
28+
with:
29+
go-version: '>=1.22'
30+
cache: true
31+
32+
- name: Goreleaser
33+
uses: goreleaser/goreleaser-action@v3
34+
with:
35+
distribution: goreleaser
36+
version: latest
37+
args: release
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
40+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

.github/workflows/release.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: release
2+
on:
3+
push:
4+
branches:
5+
- "release"
6+
jobs:
7+
test:
8+
uses: ./.github/workflows/test.yaml
9+
10+
cluster-test:
11+
uses: ./.github/workflows/cluster_test.yaml
12+
13+
xfs-test:
14+
uses: ./.github/workflows/xfstests.yaml
15+
16+
release:
17+
runs-on: ubuntu-latest
18+
needs: [test,cluster-test,xfs-test]
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 20
24+
- name: release
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GH_BOT_ACCESS_TOKEN }}
27+
run: npx semantic-release --debug

.github/workflows/release.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

.goreleaser.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
builds:
2+
- env:
3+
- CGO_ENABLED=0
4+
goos:
5+
- linux
6+
- windows
7+
- darwin
8+
goarch:
9+
- amd64
10+
- arm64
11+
binary: geesefs
12+
ldflags:
13+
- -w -extldflags '-static'
14+
- -X 'github.com/tigrisdata/geesefs/main.Version={{.Version}}'
15+
16+
archives:
17+
- format_overrides:
18+
- goos: windows
19+
format: zip
20+
name_template: "geesefs_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
21+
22+
checksum:
23+
name_template: 'checksums.txt'
24+
signs:
25+
- artifacts: checksum
26+
changelog:
27+
skip: true
28+
29+
nfpms:
30+
- formats:
31+
- apk
32+
- deb
33+
- rpm
34+
- termux.deb
35+
file_name_template: "tigris_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
36+
maintainer: Yevgeniy Firsov <[email protected]>

.releaserc.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
branches:
2+
- release
3+
plugins:
4+
- "@semantic-release/commit-analyzer"
5+
- "@semantic-release/release-notes-generator"
6+
- "@semantic-release/github"

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export CGO_ENABLED=0
1+
VERSION=$(shell git describe --tags --always)
22

33
run-test: s3proxy.jar build-debug
44
./test/run-tests.sh
@@ -20,13 +20,13 @@ get-deps: s3proxy.jar
2020
go get -t ./...
2121

2222
build:
23-
go build -ldflags "-X main.Version=`git rev-parse HEAD`"
23+
go build -ldflags "github.com/tigrisdata/geesefs/core/cfg.Version=$(VERSION)"
2424

2525
build-debug:
2626
CGO_ENABLED=1 go build -race -ldflags "-X main.Version=`git rev-parse HEAD`"
2727

2828
install:
29-
go install -ldflags "-X main.Version=`git rev-parse HEAD`"
29+
go install -ldflags "github.com/tigrisdata/geesefs/core/cfg.Version=$(VERSION)"
3030

3131

3232
.PHONY: protoc

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[![unittests](https://github.com/tigrisdata/geesefs/workflows/tests/badge.svg)]()
2+
[![xfstests](https://github.com/tigrisdata/geesefs/workflows/xfstests/badge.svg)]()
3+
[![cluster-test](https://github.com/tigrisdata/geesefs/workflows/cluster_test/badge.svg)]()
4+
15
<img src="doc/geesefs.png" height="64" width="64" align="middle" />
26

37
GeeseFS is a high-performance, POSIX-ish S3

core/backend_s3.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ func (s *S3Backend) newS3() {
264264
s.S3.Handlers.Build.RemoveByName("core.SDKVersionUserAgentHandler")
265265
s.S3.Handlers.Build.PushBackNamed(request.NamedHandler{
266266
Name: "core.SDKVersionUserAgentHandler",
267-
Fn: request.MakeAddToUserAgentHandler("GeeseFS", cfg.GEESEFS_VERSION,
267+
Fn: request.MakeAddToUserAgentHandler("GeeseFS", cfg.Version,
268268
runtime.Version(), runtime.GOOS, runtime.GOARCH),
269269
})
270270
}

0 commit comments

Comments
 (0)