-
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (42 loc) · 1.25 KB
/
maven-release.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
name: Maven Release
on:
push:
tags:
- 'v*' # Will trigger on tags that start with v (e.g. v1.0.0)
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
discussions: write # Added for releases
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0 # Added to fetch all tags
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
server-id: github
settings-path: ${{ github.workspace }}
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Build with Maven
run: mvn -B clean package --file pom.xml
- name: Create Release and Upload Assets
uses: softprops/action-gh-release@v1
with:
name: Release ${{ env.VERSION }}
files: |
target/khode-two-factor-auth-${{ env.VERSION }}.jar
draft: false
prerelease: false
fail_on_unmatched_files: false
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}