forked from HibiscusMC/HMCCosmetics
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (49 loc) · 1.57 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
name: Build Jar
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
push:
branches: [ "remapped" ]
pull_request:
branches: [ "remapped" ]
jobs:
build:
runs-on: ubuntu-latest
permissions: write-all
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Set up Gradle
uses: gradle/gradle-build-action@v3
- name: Grant execute permission to gradlew
run: chmod +x ./gradlew
- name: Build Jar
run: |
./gradlew build
mkdir -p ${{ github.workspace }}/artifacts
mv build/libs/*.jar ${{ github.workspace }}/artifacts/
- name: Set version as environment variable
run: |
RELEASE_VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}')
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
- name: Use Version Number
run: |
echo "Version number is ${{ env.RELEASE_VERSION }}"
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ env.RELEASE_VERSION }}"
prerelease: false
title: "Release ${{ env.RELEASE_VERSION }}"
files: |
${{ github.workspace }}/artifacts/*.jar
- name: DONE!!!
run: echo "done"