-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (51 loc) · 1.52 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
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
build_and_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: gradle
- run: chmod +x gradlew
- name: Build project
uses: gradle/gradle-build-action@v2
with:
gradle-version: '8.1.1'
arguments: build
- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.2
with:
path: build/libs/**.jar
- name: Generating Changelog
uses: ardalanamini/auto-changelog@v4
id: changelog
- name: Create Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: build/libs/**.jar
body: ${{ steps.changelog.outputs.changelog }}
draft: true
- name: Publish to Modrinth
uses: gradle/gradle-build-action@v2
with:
gradle-version: '8.1.1'
arguments: modrinth
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
MODRINTH_CHANGELOG: ${{ steps.changelog.outputs.changelog }}
- name: Publish to Hangar
uses: gradle/gradle-build-action@v2
with:
gradle-version: '8.1.1'
arguments: publishAllPublicationsToHangar
env:
HANGAR_CHANGELOG: ${{ steps.changelog.outputs.changelog }}
HANGAR_TOKEN: ${{ secrets.HANGAR_TOKEN }}