Skip to content

Commit

Permalink
Setup Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ampflower committed Sep 23, 2023
1 parent 9e48917 commit 2e55541
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Java CI with Gradle

on:
push:
tags-ignore:
- '**'
branches:
- '**'
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: true
- uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Build with Gradle
run: ./gradlew build --no-daemon
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
build/libs/
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish release

on:
release:
types:
- published

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
submodules: true
- uses: gradle/wrapper-validation-action@v1
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
- name: Build and publish with Gradle
run: ./gradlew build modrinth --no-daemon
env:
BUILD_RELEASE: ${{github.event.prelease == false}}
MODRINTH_TOKEN: ${{secrets.MODRINTH}}
CHANGELOG: ${{ github.event.release.body }}
- name: Upload build artifacts
uses: AButler/[email protected]
with:
files: 'build/libs/*'
repo-token: ${{secrets.GITHUB_TOKEN}}

0 comments on commit 2e55541

Please sign in to comment.