-
Notifications
You must be signed in to change notification settings - Fork 16
60 lines (51 loc) · 1.66 KB
/
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
name: Publish
on:
push:
branches: [ master, next ]
paths-ignore:
- '*.md'
- '.github/**/*.yml'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
publish:
runs-on: ubuntu-latest
name: Publish to Maven repository
steps:
- name: Checkout Git repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Restore Gradle cache
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Build with Gradle
run: |
chmod +x gradlew
./gradlew build --stacktrace
- name: Publish to Personal Maven repository
run: ./gradlew publishApiPublicationToPersonalRepository publishPluginPublicationToPersonalRepository --stacktrace
env:
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
- name: Publish to GitHub Packages Maven repository
run: ./gradlew publishApiPublicationToGitHubPackagesRepository publishPluginPublicationToGitHubPackagesRepository --stacktrace
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Archive plugin jars on GitHub
uses: actions/upload-artifact@master
with:
name: EnderContainers plugin jars
path: |
api/build/libs/*.jar
plugin/build/libs/EnderContainers-*.jar