This repository has been archived by the owner on Feb 24, 2024. It is now read-only.
forked from Minestom/Minestom
-
Notifications
You must be signed in to change notification settings - Fork 35
60 lines (58 loc) · 1.87 KB
/
pr.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: Build and test Minestom
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Setup gradle cache
uses: burrunan/gradle-cache-action@v1
with:
save-generated-gradle-jars: false
save-local-build-cache: false
save-gradle-dependencies-cache: true
save-maven-dependencies-cache: true
# Ignore some of the paths when caching Maven Local repository
maven-local-ignore-paths: |
net/minestom/
# TODO: reenable
# - name: Build Minestom
# run: ./gradlew classes testClasses
# - name: Run Minestom tests
# run: ./gradlew test
publish:
needs: [ build ]
runs-on: ubuntu-latest
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSWORD }}
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
- name: Set outputs
id: vars
run: |
export ACTUAL=${{ github.event.pull_request.head.sha }}
echo "short_commit_hash=${ACTUAL::10}" >> $GITHUB_OUTPUT
- name: Publish to Sonatype
env:
MINESTOM_VERSION: ${{ github.head_ref }}-${{ steps.vars.outputs.short_commit_hash }}
MINESTOM_CHANNEL: snapshot
run: |
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
echo "Version: ${SHORT_COMMIT_HASH}" >> $GITHUB_STEP_SUMMARY