Skip to content

Commit cb2cd37

Browse files
committed
Update github action
1 parent d6b459f commit cb2cd37

File tree

2 files changed

+19
-67
lines changed

2 files changed

+19
-67
lines changed

.github/workflows/build.yml

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,26 @@
1-
name: Java CI with Gradle
1+
name: Build
22

33
on:
4+
workflow_dispatch:
45
push:
5-
branches-ignore:
6-
- 'master'
7-
- 'feature/**'
8-
pull_request:
96

107
jobs:
11-
build:
12-
# Only run on PRs if the source branch is on someone else's repo
13-
if: "${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}"
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Setup Gradle
12+
uses: GeyserMC/actions/setup-gradle-composite@master
13+
with:
14+
setup-java_java-version: 17
1415

15-
runs-on: ubuntu-latest
16+
- name: Build MCPL
17+
run: ./gradlew build
1618

17-
steps:
18-
- name: Checkout repository
19-
# See https://github.com/actions/checkout/commits
20-
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac
21-
22-
- name: Validate Gradle wrapper
23-
# See https://github.com/gradle/wrapper-validation-action/commits
24-
uses: gradle/wrapper-validation-action@342dbebe7272035434f9baccc29a816ec6dd2c7b
25-
26-
- name: Set up JDK 17
27-
# See https://github.com/actions/setup-java/commits
28-
uses: actions/setup-java@0ab4596768b603586c0de567f2430c30f5b0d2b0
29-
with:
30-
java-version: 17
31-
distribution: temurin
32-
33-
- name: Build
34-
# See https://github.com/gradle/gradle-build-action/commits
35-
uses: gradle/gradle-build-action@3bfe3a46584a206fb8361cdedd0647b0c4204232
36-
with:
37-
arguments: build
19+
- name: Publish to Maven Repository
20+
if: ${{ success() && github.repository == 'GeyserMC/MCProtocolLib' && (github.ref_name == 'master' || startsWith(github.ref_name, 'feature/')) }}
21+
uses: gradle/gradle-build-action@3bfe3a46584a206fb8361cdedd0647b0c4204232
22+
env:
23+
ORG_GRADLE_PROJECT_geysermcUsername: ${{ vars.DEPLOY_USER }}
24+
ORG_GRADLE_PROJECT_geysermcPassword: ${{ secrets.DEPLOY_PASS }}
25+
with:
26+
arguments: publish

.github/workflows/deploy.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)