-
Notifications
You must be signed in to change notification settings - Fork 96
53 lines (49 loc) · 1.63 KB
/
publish.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
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
name: Release
on:
workflow_dispatch:
inputs:
type:
description: 'alpha/beta/release'
required: false
default: 'alpha'
changelog:
description: 'changelog'
required: false
default: ''
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check for valid input
run: |
if ! ( [ "${{github.event.inputs.type}}" = "alpha" ] || [ "${{github.event.inputs.type}}" = "beta" ] || [ "${{github.event.inputs.type}}" = "release" ] )
then
return -1
fi
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: 21
- name: checkout repository
uses: actions/checkout@v4
- name: configure gradle
uses: gradle/wrapper-validation-action@v1
- name: Grant execute permission for gradlew
if: ${{ runner.os != 'Windows' }}
run: chmod +x gradlew
- name: Do gradle release
uses: gradle/gradle-build-action@v2
with:
arguments: autoPublish
env:
CI: true
BUILD_NUMBER: ${{github.run_number}}
RELEASE_TYPE: ${{github.event.inputs.type}}
CHANGELOG: ${{github.event.inputs.changelog}}
CURSEFORGE_TOKEN: ${{secrets.CURSEFORGE}}
MODRINTH_TOKEN: ${{secrets.MODRINTH}}
GH_TOKEN: ${{secrets.GH_TOKEN}}
KOSMX_TOKEN: ${{secrets.KOSMX_TOKEN}}