-
-
Notifications
You must be signed in to change notification settings - Fork 150
108 lines (84 loc) · 2.77 KB
/
gradle-publish.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Gradle Package
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Validate gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
cache: 'gradle'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
- name: Build with Gradle
run: chmod +x gradlew && ./gradlew build
- name: Upload build artifacts api
uses: actions/upload-artifact@v4
with:
name: api-build
path: api/build/libs
- name: Upload build artifacts spigot
uses: actions/upload-artifact@v4
with:
name: spigot-build
path: spigot/build/libs
- name: Upload build artifacts netty-common
uses: actions/upload-artifact@v4
with:
name: netty-common-build
path: netty-common/build/libs
- name: Upload build artifacts bungeecord
uses: actions/upload-artifact@v4
with:
name: bungeecord-build
path: bungeecord/build/libs
- name: Upload build artifacts velocity
uses: actions/upload-artifact@v4
with:
name: velocity-build
path: velocity/build/libs
- name: Upload build artifacts fabric
uses: actions/upload-artifact@v4
with:
name: fabric-build
path: fabric/build/libs
extract-javadoc:
if: github.repository == 'retrooper/packetevents' && 'tag' == github.event.ref_type
runs-on: ubuntu-latest
permissions:
contents: read
needs:
- build
steps:
- uses: actions/download-artifact@v4
with:
merge-multiple: true
- name: Extract Javadoc Jars
run: |
ls | xargs -L 1 | awk '/.+-javadoc\.jar/{print $0}' | awk 'BEGIN{FS=OFS="-"}{NF-=3; print}' | awk '!NF || !seen[$0]++' | awk '{cmd="mkdir "$0" && unzip -d ./"$0"/ "$0"-*-javadoc.jar"; print cmd}' | tr '\n' ';' | sh && rm *'.jar'
- name: Move api javadoc to root directory
run: mv api/* ./ && rmdir api
- name: Upload Pages Artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./
deploy-javadoc:
needs: extract-javadoc
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4