Skip to content

Commit 679c5d7

Browse files
committed
refactor: update module paths to lowercase, bump confstore to v0.0.4, and add GoReleaser configuration
1 parent d45554b commit 679c5d7

File tree

10 files changed

+90
-14
lines changed

10 files changed

+90
-14
lines changed

.github/workflows/goreleaser.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Goreleaser
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
goreleaser:
10+
runs-on: ubuntu-latest
11+
steps:
12+
-
13+
name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
-
18+
name: Set up Go
19+
uses: actions/setup-go@v5
20+
-
21+
name: Run GoReleaser
22+
uses: goreleaser/goreleaser-action@v6
23+
with:
24+
# either 'goreleaser' (default) or 'goreleaser-pro'
25+
distribution: goreleaser
26+
# 'latest', 'nightly', or a semver
27+
version: '~> v2'
28+
args: release --clean
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
32+
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}

.goreleaser.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
version: 2
2+
builds:
3+
- id: github-backup
4+
main: .
5+
binary: github-backup
6+
ldflags:
7+
- -s -w -X main.BuildVersion={{.Version}}
8+
goos:
9+
- linux
10+
- darwin
11+
- windows
12+
goarch:
13+
- amd64
14+
- arm64
15+
ignore:
16+
- goos: windows
17+
goarch: arm64
18+
changelog:
19+
disable: false
20+
use: github
21+
sort: asc
22+
groups:
23+
- title: Features
24+
regexp: '^feat(\([\w-]+\))?!?:.*'
25+
order: 0
26+
- title: "Bug Fixes"
27+
regexp: '^fix(\([\w-]+\))?!?:.*'
28+
order: 1
29+
- title: "Refactor"
30+
regexp: '^refactor(\([\w-]+\))?!?:.*'
31+
order: 2
32+
- title: "Build Process Updates"
33+
regexp: '^(build|ci)(\([\w-]+\))?!?:.*'
34+
order: 3
35+
- title: "Documentation Updates"
36+
regexp: '^docs(\([\w-]+\))?!?:.*'
37+
order: 4
38+
- title: "Maintenance"
39+
regexp: '^chore(\([\w-]+\))?!?:.*'
40+
order: 5
41+
- title: Others
42+
order: 999

config/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"testing"
77

8-
"github.com/TBXark/github-backup/provider/gitea"
8+
"github.com/tbxark/github-backup/provider/gitea"
99
)
1010

1111
func TestSyncConfig(t *testing.T) {

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
module github.com/TBXark/github-backup
1+
module github.com/tbxark/github-backup
22

33
go 1.23.0
44

55
toolchain go1.23.5
66

77
require (
8-
github.com/go-sphere/confstore v0.0.3
8+
github.com/go-sphere/confstore v0.0.4
99
github.com/robfig/cron/v3 v3.0.1
1010
)

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
github.com/go-sphere/confstore v0.0.3 h1:LRMRnEDu++JZGt4onMUHKAcQ27f+8qz553S7knIyHTE=
22
github.com/go-sphere/confstore v0.0.3/go.mod h1:rvp2oSOW4x3E8JU0efD9JtHpBM2M3VIqM4rohoSMr34=
3+
github.com/go-sphere/confstore v0.0.4 h1:LJoui4Q1qryvW/rqKHAdEc0j2eLWH2Eb76LvY0vqcrk=
4+
github.com/go-sphere/confstore v0.0.4/go.mod h1:rvp2oSOW4x3E8JU0efD9JtHpBM2M3VIqM4rohoSMr34=
35
github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs=
46
github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro=

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
"fmt"
66
"log"
77

8-
"github.com/TBXark/github-backup/config"
98
"github.com/robfig/cron/v3"
9+
"github.com/tbxark/github-backup/config"
1010
)
1111

1212
var (

provider/gitea/gitea.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import (
44
"fmt"
55
"strings"
66

7-
"github.com/TBXark/github-backup/provider/provider"
8-
"github.com/TBXark/github-backup/utils/request"
7+
"github.com/tbxark/github-backup/provider/provider"
8+
"github.com/tbxark/github-backup/utils/request"
99
)
1010

1111
type Config struct {

provider/github/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"strings"
66

7-
"github.com/TBXark/github-backup/utils/request"
7+
"github.com/tbxark/github-backup/utils/request"
88
)
99

1010
type Repo struct {

provider/local/local.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"os/exec"
88
"path/filepath"
99

10-
"github.com/TBXark/github-backup/provider/provider"
10+
"github.com/tbxark/github-backup/provider/provider"
1111
)
1212

1313
type UpdateAction string

task.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import (
44
"fmt"
55
"log"
66

7-
"github.com/TBXark/github-backup/config"
8-
"github.com/TBXark/github-backup/provider/gitea"
9-
"github.com/TBXark/github-backup/provider/github"
10-
"github.com/TBXark/github-backup/provider/local"
11-
"github.com/TBXark/github-backup/provider/provider"
12-
"github.com/TBXark/github-backup/utils/matcher"
7+
"github.com/tbxark/github-backup/config"
8+
"github.com/tbxark/github-backup/provider/gitea"
9+
"github.com/tbxark/github-backup/provider/github"
10+
"github.com/tbxark/github-backup/provider/local"
11+
"github.com/tbxark/github-backup/provider/provider"
12+
"github.com/tbxark/github-backup/utils/matcher"
1313
)
1414

1515
func BuildBackupProvider(conf *config.BackupProviderConfig) (provider.Provider, error) {

0 commit comments

Comments
 (0)