-
Notifications
You must be signed in to change notification settings - Fork 89
40 lines (40 loc) · 1.18 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Build
on:
pull_request:
workflow_dispatch:
push:
branches:
- dev
jobs:
build:
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- id: setup-java
name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
# Configures gradle with caching
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
# Run "gradlew publish" for origin/dev and "gradlew build" for PRs or elsewhere
- name: Execute Gradle ${{ (github.repository == 'PGMDev/PGM' && github.ref == 'refs/heads/dev') && 'Publish' || 'Build' }}
run: ./gradlew ${{ (github.repository == 'PGMDev/PGM' && github.ref == 'refs/heads/dev') && 'publish' || 'build' }}
env:
GITHUB_TOKEN: ${{ (github.repository == 'PGMDev/PGM' && github.ref == 'refs/heads/dev') && secrets.GITHUB_TOKEN || '' }}
- id: artifact
name: Upload Jar
uses: actions/upload-artifact@v4
with:
name: PGM.jar
path: build/libs/PGM.jar
if-no-files-found: error