-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (43 loc) · 1.51 KB
/
main.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
name: Build Kwsify
on:
- push
- pull_request
jobs:
build:
strategy:
matrix:
java:
- 8
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: Setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}
- name: Make Gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: Build with shadowJar
run: ./gradlew shadowJar
- name: Create Git Tag
id: create_tag
run: version=$(cat build.gradle | grep "version =" | sed "s/version = '\(.*\)'/\1/" | tr -d "'") && git tag $version && echo "tag=$version" >> $GITHUB_OUTPUT
- name: Rename artifact file
id: rename_artifact_file
run: mv ./build/libs/*-all.jar ./kwsify-${{ steps.create_tag.outputs.tag }}.jar
- name: Upload jar to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.REPO_TOKEN }}
file: ./kwsify-${{ steps.create_tag.outputs.tag }}.jar
tag: ${{ steps.create_tag.outputs.tag }}
release_name: ${{ steps.create_tag.outputs.tag }}-Release
overwrite: true
file_glob: true
body: "Release for tag: ${{ steps.create_tag.outputs.tag }}"