workflow: fix goreleaser config and containerfile

This commit is contained in:
2025-10-15 17:17:52 +11:00
parent 23d7e1d4f9
commit 18a89ea11a
22 changed files with 57 additions and 44 deletions

View File

@@ -18,7 +18,7 @@ jobs:
with:
images: |
nite07/sub2sing-box
ghcr.io/nitezs/sub2sing-box
ghcr.io/bestnite/sub2sing-box
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}

View File

@@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
- name: Install UPX
uses: crazy-max/ghaction-upx@v3
@@ -24,7 +24,7 @@ jobs:
install-only: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest

View File

@@ -1,3 +1,4 @@
version: 2
project_name: sub2sing-box
builds:
- env:
@@ -9,16 +10,15 @@ builds:
goarch:
- amd64
- arm64
- arm
- "386"
ldflags:
- -s -w -X github.com/nitezs/sub2sing-box/constant.Version={{ .Version }}
- -s -w -X github.com/bestnite/sub2sing-box/constant.Version={{ .Version }}
flags:
- -trimpath
archives:
- format: tar.gz
- formats: ["tar.gz"]
format_overrides:
- format: zip
- formats: ["zip"]
goos: windows
wrap_in_directory: true
files:
@@ -30,3 +30,16 @@ release:
upx:
- enabled: true
compress: best
nfpms:
- id: sub2sing-box
homepage: https://github.com/bestnite/sub2sing-box
maintainer: Nite <admin@nite07.com>
license: "MIT"
formats:
- apk
- deb
- rpm
- termux.deb
- archlinux
provides:
- sub2sing-box

View File

@@ -5,7 +5,7 @@ WORKDIR /app
COPY . .
RUN go mod download
ARG version
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X github.com/nitezs/sub2sing-box/constant.Version=${version}" -o sub2sing-box .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X github.com/bestnite/sub2sing-box/constant.Version=${version}" -o sub2sing-box .
WORKDIR /app
FROM alpine:latest

View File

@@ -3,9 +3,9 @@ package handler
import (
"encoding/json"
"github.com/nitezs/sub2sing-box/common"
"github.com/nitezs/sub2sing-box/model"
"github.com/nitezs/sub2sing-box/util"
"github.com/bestnite/sub2sing-box/common"
"github.com/bestnite/sub2sing-box/model"
"github.com/bestnite/sub2sing-box/util"
"github.com/gin-gonic/gin"
)

View File

@@ -7,7 +7,7 @@ import (
"net/http"
"strconv"
"github.com/nitezs/sub2sing-box/api/handler"
"github.com/bestnite/sub2sing-box/api/handler"
"github.com/gin-gonic/gin"
)

View File

@@ -6,8 +6,8 @@ import (
"os"
"path/filepath"
"github.com/nitezs/sub2sing-box/common"
"github.com/nitezs/sub2sing-box/model"
"github.com/bestnite/sub2sing-box/common"
"github.com/bestnite/sub2sing-box/model"
"github.com/spf13/cobra"
)

View File

@@ -1,7 +1,7 @@
package cmd
import (
"github.com/nitezs/sub2sing-box/api"
"github.com/bestnite/sub2sing-box/api"
"github.com/spf13/cobra"
)

View File

@@ -3,7 +3,7 @@ package cmd
import (
"fmt"
"github.com/nitezs/sub2sing-box/constant"
"github.com/bestnite/sub2sing-box/constant"
"github.com/spf13/cobra"
)

View File

@@ -12,10 +12,10 @@ import (
"sort"
"strings"
"github.com/nitezs/sub2sing-box/constant"
"github.com/nitezs/sub2sing-box/model"
"github.com/nitezs/sub2sing-box/parser"
"github.com/nitezs/sub2sing-box/util"
"github.com/bestnite/sub2sing-box/constant"
"github.com/bestnite/sub2sing-box/model"
"github.com/bestnite/sub2sing-box/parser"
"github.com/bestnite/sub2sing-box/util"
box "github.com/sagernet/sing-box"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/include"

2
go.mod
View File

@@ -1,4 +1,4 @@
module github.com/nitezs/sub2sing-box
module github.com/bestnite/sub2sing-box
go 1.25

View File

@@ -3,7 +3,7 @@ package main
import (
"fmt"
"github.com/nitezs/sub2sing-box/cmd"
"github.com/bestnite/sub2sing-box/cmd"
)
func main() {

View File

@@ -5,8 +5,8 @@ import (
"net/url"
"strings"
"github.com/nitezs/sub2sing-box/constant"
"github.com/nitezs/sub2sing-box/model"
"github.com/bestnite/sub2sing-box/constant"
"github.com/bestnite/sub2sing-box/model"
"github.com/sagernet/sing-box/option"
)

View File

@@ -7,8 +7,8 @@ import (
"strconv"
"strings"
"github.com/nitezs/sub2sing-box/constant"
"github.com/nitezs/sub2sing-box/model"
"github.com/bestnite/sub2sing-box/constant"
"github.com/bestnite/sub2sing-box/model"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing/common/byteformats"
)

View File

@@ -5,8 +5,8 @@ import (
"net/url"
"strings"
"github.com/nitezs/sub2sing-box/constant"
"github.com/nitezs/sub2sing-box/model"
"github.com/bestnite/sub2sing-box/constant"
"github.com/bestnite/sub2sing-box/model"
"github.com/sagernet/sing-box/option"
)

View File

@@ -1,8 +1,8 @@
package parser
import (
"github.com/nitezs/sub2sing-box/constant"
"github.com/nitezs/sub2sing-box/model"
"github.com/bestnite/sub2sing-box/constant"
"github.com/bestnite/sub2sing-box/model"
)
var ParserMap map[string]func(string) (model.Outbound, error) = map[string]func(string) (model.Outbound, error){

View File

@@ -5,9 +5,9 @@ import (
"net/url"
"strings"
"github.com/nitezs/sub2sing-box/constant"
"github.com/nitezs/sub2sing-box/model"
"github.com/nitezs/sub2sing-box/util"
"github.com/bestnite/sub2sing-box/constant"
"github.com/bestnite/sub2sing-box/model"
"github.com/bestnite/sub2sing-box/util"
"github.com/sagernet/sing-box/option"
)

View File

@@ -5,9 +5,9 @@ import (
"net/url"
"strings"
"github.com/nitezs/sub2sing-box/constant"
"github.com/nitezs/sub2sing-box/model"
"github.com/nitezs/sub2sing-box/util"
"github.com/bestnite/sub2sing-box/constant"
"github.com/bestnite/sub2sing-box/model"
"github.com/bestnite/sub2sing-box/util"
"github.com/sagernet/sing-box/option"
)

View File

@@ -5,8 +5,8 @@ import (
"net/url"
"strings"
"github.com/nitezs/sub2sing-box/constant"
"github.com/nitezs/sub2sing-box/model"
"github.com/bestnite/sub2sing-box/constant"
"github.com/bestnite/sub2sing-box/model"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing/common/json/badoption"

View File

@@ -5,8 +5,8 @@ import (
"net/url"
"strings"
"github.com/nitezs/sub2sing-box/constant"
"github.com/nitezs/sub2sing-box/model"
"github.com/bestnite/sub2sing-box/constant"
"github.com/bestnite/sub2sing-box/model"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing/common/json/badoption"
)

View File

@@ -6,9 +6,9 @@ import (
"strconv"
"strings"
"github.com/nitezs/sub2sing-box/constant"
"github.com/nitezs/sub2sing-box/model"
"github.com/nitezs/sub2sing-box/util"
"github.com/bestnite/sub2sing-box/constant"
"github.com/bestnite/sub2sing-box/model"
"github.com/bestnite/sub2sing-box/util"
"github.com/sagernet/sing-box/option"
"github.com/sagernet/sing/common/json/badoption"
)