-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Ruf
committed
Dec 20, 2022
1 parent
18cdde3
commit ee85b3c
Showing
1 changed file
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Build | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
env: | ||
# For any reason, specifying this in the modrinth step does not work? | ||
# But it is also well documented here, so this should be ok to do | ||
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check tag condition | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: echo "Ref is a tag" | ||
|
||
- name: Check out project | ||
if: success() | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
if: success() | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 17 | ||
distribution: 'microsoft' | ||
|
||
- name: Setup Gradle | ||
if: success() | ||
uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-version: 7.4.2 | ||
|
||
- name: Build | ||
if: success() | ||
run: gradle remapJar | ||
|
||
- name: Release on GitHub | ||
if: success() && startsWith(github.ref, 'refs/tags/') # Failsafe check again | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
**/libs/server-portals-*.jar | ||
README.md | ||
CHANGELOG.md | ||
LICENSE | ||
body_path: CHANGELOG.md | ||
draft: false | ||
prerelease: false | ||
fail_on_unmatched_files: true | ||
|
||
- name: Upload to modrinth | ||
if: success() | ||
run: gradle modrinth |