Skip to content

Commit

Permalink
Add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Ruf committed Dec 20, 2022
1 parent 18cdde3 commit ee85b3c
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/build.yml
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

0 comments on commit ee85b3c

Please sign in to comment.