-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (34 loc) · 1.04 KB
/
java-release.yml
File metadata and controls
38 lines (34 loc) · 1.04 KB
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
name: Java CI & Release
on:
push:
branches: [ "main" ] # Runs compilation tests on main commits
tags:
- 'v*' # Triggers the release process on version tags (e.g., v1.0.0)
pull_request:
branches: [ "main" ] # Runs compilation tests on PRs to main
permissions:
contents: write # Required to create GitHub Releases and upload assets
jobs:
build:
name: "Pre Release"
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
cache: 'maven'
- name: Build with Maven
run: mvn -B clean package --file pom.xml
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
# Dynamically grabs all JAR files from the target directory
files: target/*.jar
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}