Skip to content

Commit

Permalink
Merge pull request #1089 from apernet/fix-mod-name
Browse files Browse the repository at this point in the history
fix: mod name major version suffix v2
  • Loading branch information
tobyxdd authored May 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 15e5846 + 1742f83 commit 396dd0a
Showing 71 changed files with 230 additions and 126 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/autotag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: "Create release tags for nested modules"

on:
push:
tags:
- app/v*.*.*

permissions:
contents: write

jobs:
tag:
name: "Create tags"
runs-on: ubuntu-latest
steps:
- name: "Extract tagbase"
id: extract_tagbase
uses: actions/github-script@v7
with:
script: |
const ref = context.ref;
core.info(`context.ref: ${ref}`);
const refPrefix = 'refs/tags/app/';
if (!ref.startsWith(refPrefix)) {
core.setFailed(`context.ref does not start with ${refPrefix}: ${ref}`);
return;
}
const tagbase = ref.slice(refPrefix.length);
core.info(`tagbase: ${tagbase}`);
core.setOutput('tagbase', tagbase);
- name: "Tagging core/*"
uses: actions/github-script@v7
env:
INPUT_TAGPREFIX: "core/"
INPUT_TAGBASE: ${{ steps.extract_tagbase.outputs.tagbase }}
with:
script: |
const tagbase = core.getInput('tagbase', { required: true });
const tagprefix = core.getInput('tagprefix', { required: true });
const refname = `tags/${tagprefix}${tagbase}`;
core.info(`creating ref ${refname}`);
try {
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/${refname}`,
sha: context.sha
});
core.info(`created ref ${refname}`);
return;
} catch (error) {
core.info(`failed to create ref ${refname}: ${error}`);
}
core.info(`updating ref ${refname}`)
try {
await github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: refname,
sha: context.sha
});
core.info(`updated ref ${refname}`);
return;
} catch (error) {
core.setFailed(`failed to update ref ${refname}: ${error}`);
}
- name: "Tagging extras/*"
uses: actions/github-script@v7
env:
INPUT_TAGPREFIX: "extras/"
INPUT_TAGBASE: ${{ steps.extract_tagbase.outputs.tagbase }}
with:
script: |
const tagbase = core.getInput('tagbase', { required: true });
const tagprefix = core.getInput('tagprefix', { required: true });
const refname = `tags/${tagprefix}${tagbase}`;
core.info(`creating ref ${refname}`);
try {
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/${refname}`,
sha: context.sha
});
core.info(`created ref ${refname}`);
return;
} catch (error) {
core.info(`failed to create ref ${refname}: ${error}`);
}
core.info(`updating ref ${refname}`)
try {
await github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: refname,
sha: context.sha
});
core.info(`updated ref ${refname}`);
return;
} catch (error) {
core.setFailed(`failed to update ref ${refname}: ${error}`);
}
28 changes: 14 additions & 14 deletions app/cmd/client.go
Original file line number Diff line number Diff line change
@@ -21,20 +21,20 @@ import (
"github.com/spf13/viper"
"go.uber.org/zap"

"github.com/apernet/hysteria/app/internal/forwarding"
"github.com/apernet/hysteria/app/internal/http"
"github.com/apernet/hysteria/app/internal/proxymux"
"github.com/apernet/hysteria/app/internal/redirect"
"github.com/apernet/hysteria/app/internal/sockopts"
"github.com/apernet/hysteria/app/internal/socks5"
"github.com/apernet/hysteria/app/internal/tproxy"
"github.com/apernet/hysteria/app/internal/tun"
"github.com/apernet/hysteria/app/internal/url"
"github.com/apernet/hysteria/app/internal/utils"
"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/extras/correctnet"
"github.com/apernet/hysteria/extras/obfs"
"github.com/apernet/hysteria/extras/transport/udphop"
"github.com/apernet/hysteria/app/v2/internal/forwarding"
"github.com/apernet/hysteria/app/v2/internal/http"
"github.com/apernet/hysteria/app/v2/internal/proxymux"
"github.com/apernet/hysteria/app/v2/internal/redirect"
"github.com/apernet/hysteria/app/v2/internal/sockopts"
"github.com/apernet/hysteria/app/v2/internal/socks5"
"github.com/apernet/hysteria/app/v2/internal/tproxy"
"github.com/apernet/hysteria/app/v2/internal/tun"
"github.com/apernet/hysteria/app/v2/internal/url"
"github.com/apernet/hysteria/app/v2/internal/utils"
"github.com/apernet/hysteria/core/v2/client"
"github.com/apernet/hysteria/extras/v2/correctnet"
"github.com/apernet/hysteria/extras/v2/obfs"
"github.com/apernet/hysteria/extras/v2/transport/udphop"
)

// Client flags
2 changes: 1 addition & 1 deletion app/cmd/ping.go
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import (
"github.com/spf13/viper"
"go.uber.org/zap"

"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

// pingCmd represents the ping command
16 changes: 8 additions & 8 deletions app/cmd/server.go
Original file line number Diff line number Diff line change
@@ -21,14 +21,14 @@ import (
"github.com/spf13/viper"
"go.uber.org/zap"

"github.com/apernet/hysteria/app/internal/utils"
"github.com/apernet/hysteria/core/server"
"github.com/apernet/hysteria/extras/auth"
"github.com/apernet/hysteria/extras/correctnet"
"github.com/apernet/hysteria/extras/masq"
"github.com/apernet/hysteria/extras/obfs"
"github.com/apernet/hysteria/extras/outbounds"
"github.com/apernet/hysteria/extras/trafficlogger"
"github.com/apernet/hysteria/app/v2/internal/utils"
"github.com/apernet/hysteria/core/v2/server"
"github.com/apernet/hysteria/extras/v2/auth"
"github.com/apernet/hysteria/extras/v2/correctnet"
"github.com/apernet/hysteria/extras/v2/masq"
"github.com/apernet/hysteria/extras/v2/obfs"
"github.com/apernet/hysteria/extras/v2/outbounds"
"github.com/apernet/hysteria/extras/v2/trafficlogger"
)

const (
8 changes: 4 additions & 4 deletions app/cmd/speedtest.go
Original file line number Diff line number Diff line change
@@ -9,10 +9,10 @@ import (
"github.com/spf13/viper"
"go.uber.org/zap"

"github.com/apernet/hysteria/core/client"
hyErrors "github.com/apernet/hysteria/core/errors"
"github.com/apernet/hysteria/extras/outbounds"
"github.com/apernet/hysteria/extras/outbounds/speedtest"
"github.com/apernet/hysteria/core/v2/client"
hyErrors "github.com/apernet/hysteria/core/v2/errors"
"github.com/apernet/hysteria/extras/v2/outbounds"
"github.com/apernet/hysteria/extras/v2/outbounds/speedtest"
)

var (
4 changes: 2 additions & 2 deletions app/cmd/update.go
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@ import (
"github.com/spf13/cobra"
"go.uber.org/zap"

"github.com/apernet/hysteria/app/internal/utils"
"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/app/v2/internal/utils"
"github.com/apernet/hysteria/core/v2/client"
)

const (
10 changes: 5 additions & 5 deletions app/go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
module github.com/apernet/hysteria/app
module github.com/apernet/hysteria/app/v2

go 1.21

require (
github.com/apernet/go-tproxy v0.0.0-20230809025308-8f4723fd742f
github.com/apernet/hysteria/core v0.0.0-00010101000000-000000000000
github.com/apernet/hysteria/extras v0.0.0-00010101000000-000000000000
github.com/apernet/hysteria/core/v2 v2.0.0-00010101000000-000000000000
github.com/apernet/hysteria/extras/v2 v2.0.0-00010101000000-000000000000
github.com/apernet/sing-tun v0.2.6-0.20240323130332-b9f6511036ad
github.com/caddyserver/certmagic v0.17.2
github.com/mdp/qrterminal/v3 v3.1.1
@@ -66,6 +66,6 @@ require (
rsc.io/qr v0.2.0 // indirect
)

replace github.com/apernet/hysteria/core => ../core
replace github.com/apernet/hysteria/core/v2 => ../core

replace github.com/apernet/hysteria/extras => ../extras
replace github.com/apernet/hysteria/extras/v2 => ../extras
2 changes: 1 addition & 1 deletion app/internal/forwarding/tcp.go
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import (
"io"
"net"

"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

type TCPTunnel struct {
2 changes: 1 addition & 1 deletion app/internal/forwarding/tcp_test.go
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/apernet/hysteria/app/internal/utils_test"
"github.com/apernet/hysteria/app/v2/internal/utils_test"
)

func TestTCPTunnel(t *testing.T) {
2 changes: 1 addition & 1 deletion app/internal/forwarding/udp.go
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import (
"sync/atomic"
"time"

"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

const (
2 changes: 1 addition & 1 deletion app/internal/forwarding/udp_test.go
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/apernet/hysteria/app/internal/utils_test"
"github.com/apernet/hysteria/app/v2/internal/utils_test"
)

func TestUDPTunnel(t *testing.T) {
2 changes: 1 addition & 1 deletion app/internal/http/server.go
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ import (
"strings"
"time"

"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

const (
2 changes: 1 addition & 1 deletion app/internal/http/server_test.go
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

const (
2 changes: 1 addition & 1 deletion app/internal/proxymux/manager.go
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import (
"net"
"sync"

"github.com/apernet/hysteria/extras/correctnet"
"github.com/apernet/hysteria/extras/v2/correctnet"
)

type muxManager struct {
2 changes: 1 addition & 1 deletion app/internal/proxymux/mux_test.go
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import (
"testing"
"time"

"github.com/apernet/hysteria/app/internal/proxymux/internal/mocks"
"github.com/apernet/hysteria/app/v2/internal/proxymux/internal/mocks"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
2 changes: 1 addition & 1 deletion app/internal/redirect/tcp_linux.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import (
"syscall"
"unsafe"

"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

const (
2 changes: 1 addition & 1 deletion app/internal/redirect/tcp_others.go
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import (
"errors"
"net"

"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

type TCPRedirect struct {
2 changes: 1 addition & 1 deletion app/internal/socks5/server.go
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import (

"github.com/txthinking/socks5"

"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

const udpBufferSize = 4096
2 changes: 1 addition & 1 deletion app/internal/socks5/server_test.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import (

"github.com/stretchr/testify/assert"

"github.com/apernet/hysteria/app/internal/utils_test"
"github.com/apernet/hysteria/app/v2/internal/utils_test"
)

func TestServer(t *testing.T) {
2 changes: 1 addition & 1 deletion app/internal/tproxy/tcp_linux.go
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import (
"net"

"github.com/apernet/go-tproxy"
"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

type TCPTProxy struct {
2 changes: 1 addition & 1 deletion app/internal/tproxy/tcp_others.go
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import (
"errors"
"net"

"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

type TCPTProxy struct {
2 changes: 1 addition & 1 deletion app/internal/tproxy/udp_linux.go
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import (
"time"

"github.com/apernet/go-tproxy"
"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

const (
2 changes: 1 addition & 1 deletion app/internal/tproxy/udp_others.go
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import (
"net"
"time"

"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

type UDPTProxy struct {
2 changes: 1 addition & 1 deletion app/internal/tun/server.go
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ import (
"github.com/sagernet/sing/common/network"
"go.uber.org/zap"

"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

type Server struct {
4 changes: 2 additions & 2 deletions app/internal/utils/geoloader.go
Original file line number Diff line number Diff line change
@@ -7,8 +7,8 @@ import (
"os"
"time"

"github.com/apernet/hysteria/extras/outbounds/acl"
"github.com/apernet/hysteria/extras/outbounds/acl/v2geo"
"github.com/apernet/hysteria/extras/v2/outbounds/acl"
"github.com/apernet/hysteria/extras/v2/outbounds/acl/v2geo"
)

const (
2 changes: 1 addition & 1 deletion app/internal/utils/update.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import (
"net/http"
"time"

"github.com/apernet/hysteria/core/client"
"github.com/apernet/hysteria/core/v2/client"
)

const (
Loading

0 comments on commit 396dd0a

Please sign in to comment.