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