forked from KyoriPowered/adventure
-
Notifications
You must be signed in to change notification settings - Fork 0
27 lines (25 loc) · 942 Bytes
/
build.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
name: "build"
on: ["pull_request", "push"]
jobs:
build:
# Only run on PRs if the source branch is on someone else's repo
if: ${{ github.event_name != 'pull_request' || github.repository != github.event.pull_request.head.repo.full_name }}
strategy:
matrix:
os: ["ubuntu-latest", "windows-latest"]
runs-on: "${{ matrix.os }}"
steps:
- name: "checkout repository"
uses: "actions/checkout@v2"
- name: "setup jdk 11"
uses: "actions/setup-java@v1"
with:
java-version: "11"
- name: "build"
run: "./gradlew build"
- name: "publish"
if: ${{ runner.os == 'Linux' && github.event_name == 'push' && github.ref == 'refs/heads/master' }}
run: "./gradlew publish"
env:
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }}