-
Notifications
You must be signed in to change notification settings - Fork 15
77 lines (75 loc) · 3 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Upload Release Artifacts
on:
push:
tags:
- '*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'microsoft'
java-version: 17
- name: Get current time
uses: srfrnk/current-time@master
id: current-time
with:
format: YYYYMMDDHHmmss
- name: Setup ENV
run: echo "TAG=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Copy Maven Upload URL
id: extract_maven_upload_url
run: echo "maven_upload_url=${{secrets.MAVEN_UPLOAD_URL}}" >> $GITHUB_OUTPUT
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
env:
BUILD_TIME: ${{ steps.current-time.outputs.formattedTime }}
BUILD_NUMBER: ${{ github.run_number }}
run: ./gradlew assemble
- name: Maven Release
if: steps.extract_maven_upload_url.outputs.maven_upload_url
env:
BUILD_TIME: ${{ steps.current-time.outputs.formattedTime }}
BUILD_NUMBER: ${{ github.run_number }}
MAVEN_UPLOAD_URL: ${{ secrets.MAVEN_UPLOAD_URL }}
MAVEN_UPLOAD_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }}
MAVEN_UPLOAD_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }}
run: ./gradlew publish
- name: Publish (GitHub Releases)
uses: Kir-Antipov/mc-publish@423b200ec84e6eefad726549c72513d7a9b4c2c0 # (new) v3.3
with:
github-token: ${{ github.token }}
files: |
**/build/libs/!(*-@(dev|sources|javadoc|slim)).jar
**/build/libs/*-@(sources|javadoc).jar
- name: Publish (NeoForge)
uses: Kir-Antipov/mc-publish@423b200ec84e6eefad726549c72513d7a9b4c2c0 # (new) v3.3
with:
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
version: ${{ github.ref_name }}+NeoForge
files: |
NeoForge/build/libs/!(*-@(dev|sources|javadoc|slim)).jar
NeoForge/build/libs/*-@(sources|javadoc).jar
- name: Publish (Quilt)
uses: Kir-Antipov/mc-publish@423b200ec84e6eefad726549c72513d7a9b4c2c0 # (new) v3.3
with:
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
version: ${{ github.ref_name }}+Quilt
files: |
Quilt/build/libs/!(*-@(dev|sources|javadoc|slim)).jar
Quilt/build/libs/*-@(sources|javadoc).jar
- name: Publish (Fabric)
uses: Kir-Antipov/mc-publish@423b200ec84e6eefad726549c72513d7a9b4c2c0 # (new) v3.3
with:
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
version: ${{ github.ref_name }}+Fabric
files: |
Fabric/build/libs/!(*-@(dev|sources|javadoc|slim)).jar
Fabric/build/libs/*-@(sources|javadoc).jar