Some checks failed
Gitea Actions Build / build and releases (push) Failing after 4m11s
6.0 KiB
6.0 KiB
com.mingliqiye.gitea.releases
language
说明
- 为了下载速度与处处碰壁的GITHUB
- 特地开发了一款可以上传gitea.releases的脚本
- 使用Java17 + gradle8.12 + okhttp3 + giteaWebApi
Gitea文档
使用
脚本下载
- name: setup java
uses: https://git.mingliqiye.com/Actions/setup-java@v4
with:
distribution: 'zulu'
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文件
- name: setup java
uses: https://git.mingliqiye.com/Actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
- name: releases
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"
命令行参数
序号 | 作用 | 短参数 | 长参数 | 类型 | 默认值 | 是否必须 | 示例 |
---|---|---|---|---|---|---|---|
1 | 显示帮助信息 | -h | --help | 没有值 | 无 | 否 | 无 |
2 | 显示版本信息 | -i | --info | 没有值 | 无 | 否 | 无 |
3 | 团队名 | -o | --repository-owner | string | 无 | 是 | Actions |
4 | 仓库名 | -r | --repository-name | string | 无 | 是 | com.mingliqiye.gitea.releases |
5 | releases的标题 | -ti | --title | string | 无 | 否 | Auto releases |
6 | releases的描述 | -b | --body | string | 无 | 否 | Auto releases${sha} |
7 | 服务器url | -s | --server-url | string | 无 | 是 | https://git.mingliqiye.com/ |
8 | 标签名 | -tn | --tag-name | string | 无 | 是 | Auto-releases |
9 | 提交版本 | -tc | --target-commitish | string | 无 | 否 | 无 |
10 | 是否为预发布 | -p | --pre-release | boolean | false | 否 | false |
11 | 是否为草稿 | -d | --draft | boolean | false | 否 | false |
编译
- 如果你想自行编译
1.克隆存储库
使用 http
git clone https://git.mingliqiye.com/Actions/com.mingliqiye.gitea.releases
使用 SHH
git clone git@git.mingliqiye.com:Actions/com.mingliqiye.gitea.releases.git
2.编译
使用本地 gradle
gradle
gradle build-jar
使用 gradle wrapper
- 如果你的地区下载 gradle wrapper 慢的话 gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
# 使用tencent云镜像
distributionUrl=https\://mirrors.cloud.tencent.com/gradle//gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
- 然后
./gradlew
./gradlew build-jar
3.编译成功
> Task :help
Welcome to Gradle 8.12.
To run a build, run gradle <task> ...
...
For more on this, please refer to https://docs.gradle.org/8.12/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD SUCCESSFUL in 139ms
1 actionable task: 1 executed
> Task :compileJava
...
> Task :build-jar
>>> 构建成功!
>>> MD5: eafdeef5e2a6fabf6e0061795c57928d
>>> SHA1: 47e7905ef61de09a7836e43e77b0074b08e59756
>>> SHA256: 2e879a556a344673cc004cd819778d2a5dfea65d619646c4a94ae83c03f91c8a
>>> 输出文件: D:\data\java\com.mingliqiye.gitea.releases\build\libs\com.mingliqiye.gitea.releases-1.1.jar
>>> 输出文件: D:\data\java\com.mingliqiye.gitea.releases\build\libs\com.mingliqiye.gitea.releases-1.1.jar.MD5.txt
>>> 输出文件: D:\data\java\com.mingliqiye.gitea.releases\build\libs\com.mingliqiye.gitea.releases-1.1.jar.SHA1.txt
>>> 输出文件: D:\data\java\com.mingliqiye.gitea.releases\build\libs\com.mingliqiye.gitea.releases-1.1.jar.SHA256.txt
>>> 文件大小: 6.04875278472900390625 MB
[Incubating] Problems report is available at: file:///D:/data/java/com.mingliqiye.gitea.releases/build/reports/problems/problems-report.html
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.12/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD SUCCESSFUL in 3s
7 actionable tasks: 6 executed, 1 up-to-date
-
恭喜! 看到这样的输出就证明你编译成功了
-
还可以测试运行一下
java -jar ${FILENAME} -i