-
Notifications
You must be signed in to change notification settings - Fork 106
54 lines (47 loc) · 1.82 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Build
on:
push:
paths-ignore:
- 'readmes/*'
- '*.md'
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
java-version: 21
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: |
./gradlew build
- name: Upload Artifact
uses: actions/upload-artifact@v3
if: github.ref != format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was NOT triggered by the default branch
with:
name: build
path: build/libs/*
- name: Remove *-dev.jar
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was triggered by the default branch
run: rm ./build/libs/*-dev.jar || true
- name: Remove *-api.jar
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was triggered by the default branch
run: rm ./build/libs/*-api.jar || true
- name: Create prerelease
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch) # Only runs if this CI was triggered by the default branch
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "prerelease"
prerelease: true
title: "Prerelease Build"
files: |
./build/libs/*.jar