-
Notifications
You must be signed in to change notification settings - Fork 4
100 lines (86 loc) · 3.38 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Upload Release Artifacts
on:
push:
tags:
- '*'
env:
BUILD_NUMBER: ${{ github.run_number }}
JAVA_VERSION: 21
MAVEN_UPLOAD_URL: ${{ secrets.MAVEN_UPLOAD_URL }}
MAVEN_UPLOAD_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }}
MAVEN_UPLOAD_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }}
TAG: ${{ github.ref_name }}
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout latest commit.
uses: actions/checkout@v4
- name: Get time of build
uses: srfrnk/current-time@master
id: current-time
with:
format: YYYYMMDDHHmmss
- name: Set up JDK ${{ env.JAVA_VERSION }}
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: 'microsoft'
cache: 'gradle'
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v4
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Build with Gradle
env:
BUILD_TIME: ${{ steps.current-time.outputs.formattedTime }}
run: ./gradlew assemble
- name: Maven Release
if: ${{ env.MAVEN_UPLOAD_URL }}
run: ./gradlew publish
- name: Publish (GitHub Releases)
id: publish_github
uses: Kir-Antipov/[email protected]
with:
github-token: ${{ github.token }}
version: ${{ env.TAG }}
files: |
**/build/libs/!(*-@(dev|sources|javadoc|slim)).jar
**/build/libs/*-@(sources|javadoc).jar
- name: Publish (NeoForge)
id: publish_neoforge
uses: Kir-Antipov/[email protected]
with:
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
version: ${{ env.TAG }}+neoforge
files: |
neoforge/build/libs/!(*-@(dev|sources|javadoc|slim)).jar
neoforge/build/libs/*-@(sources|javadoc).jar
- name: Publish (Fabric)
id: publish_fabric
uses: Kir-Antipov/[email protected]
with:
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
version: ${{ env.TAG }}+fabric
files: |
fabric/build/libs/!(*-@(dev|sources|javadoc|slim)).jar
fabric/build/libs/*-@(sources|javadoc).jar
- name: Post to BlueSky
uses: myConsciousness/bluesky-post@v5
with:
text: "It's update time! :D
An update has been released for Mysterious Biomes via [CurseForge](https://www.curseforge.com/minecraft/mc-mods/mysterious-biomes) and [Modrinth](https://modrinth.com/mod/mysterious-biomes)! [Check out my other mods here!](https://tophatcat.dev)"
tags: "modding,minecraft,mods"
retry-count: 5
identifier: ${{ secrets.BLUESKY_IDENTIFIER }}
password: ${{ secrets.BLUESKY_PASSWORD }}
- name: Post to Discord
uses: Up-Mods/action-discord-release@main
with:
version: ${{ env.TAG }}
webhook-url: ${{ secrets.ANNOUNCEMENT_WEBHOOK_URL }}
curseforge-project-id: ${{ steps.publish_fabric.outputs.curseforge-id }}
modrinth-project-id: ${{ steps.publish_fabric.outputs.modrinth-id }}
thumbnail-url: https://raw.githubusercontent.com/kiris-mods/mysterious-biomes/refs/heads/dev/common/src/main/resources/logo.png