Compare commits

...

17 Commits

Author SHA1 Message Date
9ce0894295
更新 .gitea/workflows/action.yaml
All checks were successful
Gitea Actions Build / build and releases (push) Successful in 45s
2025-06-26 21:21:38 +08:00
1c459ca6a2
更新 install.sh
Some checks failed
Gitea Actions Build / build and releases (push) Has been cancelled
2025-06-26 21:20:40 +08:00
187dd35820
up use jdk8
All checks were successful
Gitea Actions Build / build and releases (push) Successful in 5m3s
2025-06-19 08:27:49 +08:00
8bee2d447d
use jdk8
Some checks failed
Gitea Actions Build / build and releases (push) Failing after 4m11s
2025-06-19 08:14:04 +08:00
2b78e8fdae
use jdk8
Some checks failed
Gitea Actions Build / build and releases (push) Has been cancelled
2025-06-19 08:12:48 +08:00
d348bae913
wp
All checks were successful
Gitea Actions Build / build and releases (push) Successful in 5m24s
2025-06-18 23:47:56 +08:00
18afe87e4e
bg
Some checks failed
Gitea Actions Build / build and releases (push) Failing after 8m15s
2025-06-18 23:33:42 +08:00
cefe9b4087
gradlew reo
All checks were successful
Gitea Actions Build / build and releases (push) Successful in 7m58s
2025-06-18 23:21:50 +08:00
902442e7a5
w
Some checks failed
Gitea Actions Build / build and releases (push) Has been cancelled
2025-06-18 23:10:01 +08:00
b68da87252
更新 md
All checks were successful
Gitea Actions Build / build and releases (push) Successful in 5m47s
2025-06-18 22:35:14 +08:00
59f2a06504
更新 md
Some checks failed
Gitea Actions Build / build and releases (push) Has been cancelled
2025-06-18 22:34:20 +08:00
3f6d224b53
更新 md
Some checks failed
Gitea Actions Build / build and releases (push) Has been cancelled
2025-06-18 22:30:57 +08:00
96b726efed
更新 install.sh
All checks were successful
Gitea Actions Build / build and releases (push) Successful in 10m18s
2025-06-18 22:19:07 +08:00
495d24feca
更新 install.sh
Some checks failed
Gitea Actions Build / build and releases (push) Has been cancelled
2025-06-18 22:18:39 +08:00
a77e05a088
测试环境
Some checks failed
Gitea Actions Build / TestEnv (push) Successful in 2s
Gitea Actions Build / build and releases (push) Has been cancelled
2025-06-18 22:13:46 +08:00
a162f269d4
修复 git-tag重复的问题
All checks were successful
Gitea Actions Build / build and releases (push) Successful in 6m13s
2025-06-18 22:01:00 +08:00
109a2bd91e
add install.sh
Some checks failed
Gitea Actions Build / build and releases (push) Failing after 7m20s
2025-06-18 21:46:11 +08:00
6 changed files with 82 additions and 38 deletions

View File

@ -7,24 +7,17 @@ on:
- master - master
jobs: jobs:
Task: Build And Releases:
name: build and releases name: build and releases
runs-on: ubuntu-latest runs-on: ubuntu-dev
steps: steps:
- name: Check out repository code - name: Check out repository code
uses: https://git.mingliqiye.com/Actions/checkout@v4 uses: https://git.mingliqiye.com/Actions/checkout@v4
- name: setup java
uses: https://git.mingliqiye.com/Actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
- name: build - name: build
run: | run: |
./gradlew gradle
./gradlew build-jar gradle build-jar
- name: releases - name: releases
run: | run: |
@ -32,7 +25,5 @@ jobs:
GROUPSID=$(echo "$GROUPSID" | tr -d '\r') GROUPSID=$(echo "$GROUPSID" | tr -d '\r')
VERSIONS=$(echo "$VERSIONS" | tr -d '\r') VERSIONS=$(echo "$VERSIONS" | tr -d '\r')
FILENAME="${GROUPSID}-${VERSIONS}.jar" FILENAME="${GROUPSID}-${VERSIONS}.jar"
java -jar build/libs/${FILENAME} -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}" -a "build/libs" java -jar build/libs/${FILENAME} -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}-${{gitea.sha}}" -a "build/libs"

View File

@ -8,7 +8,7 @@
- 为了下载速度与处处碰壁的GITHUB - 为了下载速度与处处碰壁的GITHUB
- 特地开发了一款可以上传gitea.releases的脚本 - 特地开发了一款可以上传gitea.releases的脚本
- 使用Java17 + gradle8.12 + okhttp3 + giteaWebApi - 使用Java8 + gradle8.12 + okhttp3 + giteaWebApi
### Gitea文档 ### Gitea文档
@ -17,15 +17,34 @@
## 使用 ## 使用
action.yaml - 查看 [com.mingliqiye.libs/action.yaml](https://git.mingliqiye.com/mingliqiye/com.mingliqiye.libs/src/branch/master/.gitea/workflows/action.yaml#L15)
### 脚本下载
```yaml ```yaml
- name: setup java - name: setup java
uses: https://git.mingliqiye.com/Actions/setup-java@v4 uses: https://git.mingliqiye.com/Actions/setup-java@v4
with: with:
distribution: 'oracle' distribution: 'zulu'
java-version: '17' java-version: '8'
- name: releases
run: |
curl -o- https://git.mingliqiye.com/Actions/com.mingliqiye.gitea.releases/raw/branch/master/install.sh | sh
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}" -a "build/libs"
```
### 下载jar文件
[Releases](/releases)
```yaml
- name: setup java
uses: https://git.mingliqiye.com/Actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
- name: releases - name: releases
run: | run: |
java -jar ${FILENAME} -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}" -a "build/libs" java -jar ${FILENAME} -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}" -a "build/libs"
@ -47,30 +66,38 @@ action.yaml
| 10 | 是否为预发布 | -p | --pre-release | boolean | false | 否 | false | | 10 | 是否为预发布 | -p | --pre-release | boolean | false | 否 | false |
| 11 | 是否为草稿 | -d | --draft | boolean | false | 否 | false | | 11 | 是否为草稿 | -d | --draft | boolean | false | 否 | false |
# 编译 # 编译
- 如果你想自行编译 - 如果你想自行编译
## 1.克隆存储库 ## 1.克隆存储库
### 使用 http ### 使用 http
```shell ```shell
git clone https://git.mingliqiye.com/Actions/com.mingliqiye.gitea.releases git clone https://git.mingliqiye.com/Actions/com.mingliqiye.gitea.releases
``` ```
### 使用 SHH ### 使用 SHH
```shell ```shell
git clone git@git.mingliqiye.com:Actions/com.mingliqiye.gitea.releases.git git clone git@git.mingliqiye.com:Actions/com.mingliqiye.gitea.releases.git
``` ```
## 2.编译 ## 2.编译
### 使用本地 gradle ### 使用本地 gradle
```shell ```shell
gradle gradle
gradle build-jar gradle build-jar
``` ```
### 使用 gradle wrapper ### 使用 gradle wrapper
- 如果你的地区下载 gradle wrapper 慢的话 - 如果你的地区下载 gradle wrapper 慢的话
[gradle-wrapper.properties](gradle/wrapper/gradle-wrapper.properties) [gradle-wrapper.properties](gradle/wrapper/gradle-wrapper.properties)
```properties ```properties
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
@ -81,11 +108,14 @@ validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
``` ```
- 然后 - 然后
```shell ```shell
./gradlew ./gradlew
./gradlew build-jar ./gradlew build-jar
``` ```
### 3.编译成功 ### 3.编译成功
``` ```
@ -127,6 +157,7 @@ For more on this, please refer to https://docs.gradle.org/8.12/userguide/command
BUILD SUCCESSFUL in 3s BUILD SUCCESSFUL in 3s
7 actionable tasks: 6 executed, 1 up-to-date 7 actionable tasks: 6 executed, 1 up-to-date
``` ```
- 恭喜! 看到这样的输出就证明你编译成功了 - 恭喜! 看到这样的输出就证明你编译成功了
- 还可以测试运行一下 - 还可以测试运行一下

View File

@ -8,7 +8,7 @@
- Developed to address slow download speeds and accessibility issues with GitHub - Developed to address slow download speeds and accessibility issues with GitHub
- A script specifically designed to upload files to Gitea Releases - A script specifically designed to upload files to Gitea Releases
- Built with Java 17 + Gradle 8.12 + OkHttp3 + Gitea Web API - Built with Java 8 + Gradle 8.12 + OkHttp3 + Gitea Web API
### Gitea Documentation ### Gitea Documentation
@ -23,8 +23,8 @@ action.yaml
- name: Setup Java - name: Setup Java
uses: https://git.mingliqiye.com/Actions/setup-java@v4 uses: https://git.mingliqiye.com/Actions/setup-java@v4
with: with:
distribution: 'oracle' distribution: 'zulu'
java-version: '17' java-version: '8'
- name: Releases Upload - name: Releases Upload
run: | run: |

View File

@ -12,16 +12,13 @@ String jarName = "${jarNameStr}.jar"
group = GROUPSID group = GROUPSID
version = VERSIONS version = VERSIONS
allprojects {
repositories { repositories {
mavenLocal() maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/google' } maven { url "https://maven.aliyun.com/repository/gradle-plugin" }
maven { url 'https://maven.aliyun.com/repository/central' } maven { name "M2"; url 'https://plugins.gradle.org/m2/' }
maven { url 'https://maven.aliyun.com/repository/public' } mavenCentral()
maven { url "https://maven.aliyun.com/repository/gradle-plugin" } }
maven { url "https://maven.aliyun.com/repository/spring-plugin" }
mavenCentral()
gradlePluginPortal()
} }
@ -31,8 +28,8 @@ dependencies {
compileOnly 'org.projectlombok:lombok:1.18.36' compileOnly 'org.projectlombok:lombok:1.18.36'
annotationProcessor 'org.projectlombok:lombok:1.18.36' annotationProcessor 'org.projectlombok:lombok:1.18.36'
implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.16' implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.16'
implementation 'ch.qos.logback:logback-classic:1.5.16' implementation 'ch.qos.logback:logback-classic:1.2.12'
implementation 'org.slf4j:slf4j-api:2.0.16' implementation 'org.slf4j:slf4j-api:1.7'
implementation 'args4j:args4j:2.37' implementation 'args4j:args4j:2.37'
implementation 'com.alibaba.fastjson2:fastjson2:2.0.57' implementation 'com.alibaba.fastjson2:fastjson2:2.0.57'
implementation 'commons-cli:commons-cli:1.9.0' implementation 'commons-cli:commons-cli:1.9.0'

View File

@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://mirrors.cloud.tencent.com/gradle//gradle-8.12-bin.zip distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.12-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

25
install.sh Normal file
View File

@ -0,0 +1,25 @@
curl -o releases.json https://git.mingliqiye.com/api/v1/repos/Actions/com.mingliqiye.gitea.releases/releases
FILENAME=$(python3 -c "
import json;
with open('releases.json') as f:
data = json.load(f)
print(data[0]['assets'][0]['name'])
")
DOWNLOADURL=$(python3 -c "
import json;
with open('releases.json') as f:
data = json.load(f)
print(data[0]['assets'][0]['browser_download_url'])
")
echo "fileName:$FILENAME"
echo "BrowserDownloadUrl:$DOWNLOADURL"
echo "Downloading ... $FILENAME"
curl -O "$DOWNLOADURL"
mv "$FILENAME" com.mingliqiye.gitea.releases.jar
rm releases.json
ls
echo com.mingliqiye.gitea.releases.jar Downloaded