-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (49 loc) · 1.94 KB
/
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
50
51
52
53
54
55
56
57
name: "Release stable"
on:
push:
branches: [ "main" ]
jobs:
build:
if: "!contains(github.event.head_commit.message, 'ci ignore')"
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven
- name: "Get version"
id: metadata
run: |
javac -d . src/main/java/xxAROX/PresenceMan/Application/AppInfo.java
echo "VERSION=$(java xxAROX.PresenceMan.Application.AppInfo)" >> $GITHUB_OUTPUT
echo ${{ steps.metadata.outputs.VERSION }}
- name: Build with Maven
run: |
mvn install:install-file -Dfile=./lib/discord-game-sdk4j-0.5.5.jar -DgroupId=discord-game-sdk4j -DartifactId=discord-game-sdk -Dversion=0.5.5 -Dpackaging=jar
mvn -B package --file pom.xml
- name: Rename JAR
run: |
cd target/
cp Application-1.0-SNAPSHOT.jar Presence-Man-App-v${{ steps.metadata.outputs.VERSION }}.jar
cp Application-1.0-SNAPSHOT.jar Presence-Man-App.jar
cd ../
- name: "Create Release"
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
draft: false
automatic_release_tag: "v${{ steps.metadata.outputs.VERSION }}"
prerelease: false
title: "Release v${{ steps.metadata.outputs.VERSION }}"
files: "target/Presence-Man-App.jar"
- name: "Create latest_version.txt"
run: "echo \"${{ steps.metadata.outputs.VERSION }}\" > latest_version.txt"
- name: "Update latest_version.txt"
uses: "test-room-7/action-update-file@v1"
with:
file-path: latest_version.txt
commit-msg: "Updated latest version to ${{ steps.metadata.outputs.VERSION }} - ci ignore"
github-token: ${{ secrets.GITHUB_TOKEN }}