Compare commits

..

6 Commits

Author SHA1 Message Date
c08d5813c0
更新 gradle.properties
All checks were successful
Gitea Actions Build / Build (push) Successful in 48s
2025-07-10 08:42:23 +08:00
b3fe493804
更新 build.gradle.kts
Some checks failed
Gitea Actions Build / Build (push) Has been cancelled
2025-07-10 08:42:11 +08:00
131bf0efe2
删除 workflows/build.yaml
Some checks failed
Gitea Actions Build / Build (push) Has been cancelled
2025-07-10 08:41:26 +08:00
81a031b69f
删除 build.yaml
Some checks failed
Gitea Actions Build / Build (push) Has been cancelled
2025-07-10 08:41:16 +08:00
f645ffacdf
Merge remote-tracking branch 'origin/master'
All checks were successful
Gitea Actions Build / Build (push) Successful in 49s
2025-07-09 23:01:24 +08:00
2a15ab653f
no message 2025-07-09 23:00:31 +08:00
5 changed files with 12 additions and 63 deletions

View File

@ -1,4 +1,3 @@
import java.security.MessageDigest
import java.text.SimpleDateFormat
import java.util.Date
@ -36,7 +35,7 @@ dependencies {
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
implementation("com.mingliqiye:string-utilts:1.0.4")
implementation("com.mingliqiye:string-utils:1.0.4")
implementation("org.jetbrains:annotations:24.0.0")
annotationProcessor("org.jetbrains:annotations:24.0.0")
}

View File

@ -1,27 +0,0 @@
name: Gitea Actions Build
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on:
push:
branches:
- master
jobs:
Build:
runs-on: ubuntu-dev
steps:
- name: Check out repository code
uses: https://git.mingliqiye.com/Actions/checkout@v4
- name: build-test
run: |
source gradle.properties
gradle
gradle build-jar
- name: Releases
run: |
source gradle.properties
SHA=${{gitea.sha}}
curl -o- https://git.mingliqiye.com/Actions/com.mingliqiye.gitea.releases/raw/branch/master/install.sh | bash
FILENAME="${GROUPSID}-${VERSIONS}.jar"
java -jar com.mingliqiye.gitea.releases.jar -s "${{gitea.server_url}}" -o "${{gitea.repository_owner}}" -r ${{gitea.event.repository.name}} -t "${{gitea.token}}" -ti "Auto releases ${{gitea.sha}} ${VERSIONS}" -b "# Auto releases wtih ${{gitea.event.head_commit.message}} - [${{gitea.sha}}](${{gitea.event.head_commit.url}})" -tn "Auto-Releases-${VERSIONS}-${SHA:0:10}" -a "build/libs"

View File

@ -1,5 +1,5 @@
GROUPSID=com.mingliqiye
ARTIFACTID=network-endpoint
VERSIONS=1.0.2
VERSIONS=1.0.4
MAINCLASS=com.mingliqiye
JDKVERSIONS=1.8

View File

@ -56,12 +56,14 @@ public class NetworkAddress implements Serializable {
public static NetworkAddress of(String domip) {
return new NetworkAddress(domip);
}
public static NetworkAddress of(InetAddress inetAddress) {
return new NetworkAddress(inetAddress.getHostAddress());
}
public InetAddress toInetAddress(){
public InetAddress toInetAddress() {
try {
return InetAddress.getByName(domain);
return InetAddress.getByName(ip != null ? ip : domain);
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
@ -74,7 +76,8 @@ public class NetworkAddress implements Serializable {
* @return IP地址
* @throws UnknownHostException 没找到对应的IP
*/
public static String getHostIp(@NotNull String domain) throws UnknownHostException {
public static String getHostIp(@NotNull String domain)
throws UnknownHostException {
InetAddress[] addresses = InetAddress.getAllByName(domain.trim());
return addresses[0].getHostAddress();
}
@ -110,9 +113,10 @@ public class NetworkAddress implements Serializable {
}
public String toString() {
return isdom?StringUtil.format("NetworkAddress(IP='{}',type='{}'," +
"domain='{}')",ip,IPv,domain):
StringUtil.format("NetworkAddress(IP='{}',type='{}')",ip,IPv);
return isdom ? StringUtil.format(
"NetworkAddress(IP='{}',type='{}'," + "domain='{}')", ip, IPv,
domain) :
StringUtil.format("NetworkAddress(IP='{}',type='{}')", ip, IPv);
}
}

View File

@ -1,27 +0,0 @@
name: Gitea Actions Build
run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
on:
push:
branches:
- master
jobs:
Build:
runs-on: ubuntu-dev
steps:
- name: Check out repository code
uses: https://git.mingliqiye.com/Actions/checkout@v4
- name: build-test
run: |
source gradle.properties
gradle
gradle build-jar
- name: Releases
run: |
source gradle.properties
SHA=${{gitea.sha}}
curl -o- https://git.mingliqiye.com/Actions/com.mingliqiye.gitea.releases/raw/branch/master/install.sh | bash
FILENAME="${GROUPSID}-${VERSIONS}.jar"
java -jar com.mingliqiye.gitea.releases.jar -s "${{gitea.server_url}}" -o "${{gitea.repository_owner}}" -r ${{gitea.event.repository.name}} -t "${{gitea.token}}" -ti "Auto releases ${{gitea.sha}} ${VERSIONS}" -b "# Auto releases wtih ${{gitea.event.head_commit.message}} - [${{gitea.sha}}](${{gitea.event.head_commit.url}})" -tn "Auto-Releases-${VERSIONS}-${SHA:0:10}" -a "build/libs"