Compare commits

..

No commits in common. "master" and "Auto-Releases-1.0.2-76f2581a9f" have entirely different histories.

6 changed files with 65 additions and 13 deletions

View File

@ -22,5 +22,6 @@ jobs:
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" -a "build/publications/mavenJava"
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,3 +1,4 @@
import java.security.MessageDigest
import java.text.SimpleDateFormat
import java.util.Date
@ -35,7 +36,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-utils:1.0.4")
implementation("com.mingliqiye:string-utilts:1.0.4")
implementation("org.jetbrains:annotations:24.0.0")
annotationProcessor("org.jetbrains:annotations:24.0.0")
}

27
build.yaml Normal file
View File

@ -0,0 +1,27 @@
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.4
VERSIONS=1.0.2
MAINCLASS=com.mingliqiye
JDKVERSIONS=1.8

View File

@ -56,14 +56,12 @@ 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(ip != null ? ip : domain);
return InetAddress.getByName(domain);
} catch (UnknownHostException e) {
throw new RuntimeException(e);
}
@ -76,8 +74,7 @@ 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();
}
@ -113,10 +110,9 @@ 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);
}
}

27
workflows/build.yaml Normal file
View File

@ -0,0 +1,27 @@
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"