-
Notifications
You must be signed in to change notification settings - Fork 2
50 lines (41 loc) · 1.17 KB
/
release.yml
File metadata and controls
50 lines (41 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# 关键:修复 Permission denied(并顺带修复可能的 CRLF 问题)
- name: Prepare Gradle Wrapper
shell: bash
run: |
chmod +x ./gradlew
sed -i 's/\r$//' ./gradlew
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: gradle
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2
- name: Build
run: ./gradlew --no-daemon clean build
# 这一步会自动创建 GitHub Release,并把你选的文件上传为附件
- name: Create GitHub Release + Upload Assets
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
**/build/libs/*.jar
**/build/libs/*.jar.asc
**/build/libs/*.pom
**/build/libs/*.module
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}