Skip to content

Commit

Permalink
add build and release actions
Browse files Browse the repository at this point in the history
Co-authored-by: TheEpicBlock <[email protected]>
  • Loading branch information
sisby-folk committed Jul 28, 2024
1 parent 49056da commit 18a0d10
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
indent_size = 4
indent_style = tab
tab_width = 4
insert_final_newline = true

[*.yml]
indent_size = 2
indent_style = space

[*.java]
ij_java_block_brace_style = end_of_line
ij_java_lambda_brace_style = end_of_line
ij_java_method_brace_style = end_of_line
ij_java_names_count_to_use_import_on_demand = 999

[{*.gant,*.groovy,*.gy,*.gradle}]
ij_groovy_block_brace_style = end_of_line
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Build

on: [ push, pull_request ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup jdk
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
validate-wrappers: true

- name: Build with Gradle
run: ./gradlew build
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Release

on:
release:
types:
- published

jobs:
upload:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup jdk
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
validate-wrappers: true

- name: Build with Gradle
run: ./gradlew build

- name: Upload GitHub release
uses: AButler/[email protected]
with:
files: 'build/libs/*.jar;!build/libs/*-sources.jar;!build/libs/*-dev.jar'
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Publish to Modrinth
run: ./gradlew modrinth
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_MASCOT_TOKEN }}
CHANGELOG: ${{ github.event.release.body }}

- name: Sync README
run: ./gradlew modrinthSyncBody
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_MASCOT_TOKEN }}
3 changes: 0 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ org.gradle.caching=true
org.gradle.parallel=true
org.gradle.caching.debug=false
org.gradle.configureondemand=true

# Loom
fabric.loom.multiProjectOptimisation=true

# Mod Metadata
archivesName=ballotbox
group=net.modfest
Expand All @@ -20,7 +18,6 @@ homepage=https://modrinth.com/mod/ballotbox
issues=https://github.com/modfest/ballotbox/issues
sources=https://github.com/modfest/ballotbox
license=MIT

# Mod Version
baseVersion=0.4.2
branch=1.21

0 comments on commit 18a0d10

Please sign in to comment.