Skip to content

Commit

Permalink
Add CI/CD
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Feb 9, 2025
1 parent 538b3d5 commit 04ae99d
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Build

on:
push:
pull_request:
workflow_dispatch:

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

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

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

on:
workflow_dispatch:
inputs:
mod_version:
description: 'Mod Version'
default: '1.5.0'
required: true

env:
MOD_VERSION: ${{ inputs.mod_version }}

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'gradle'

# TODO: Setup Crowdin project
# - name: crowdin action
# uses: crowdin/github-action@v2
# with:
# push_sources: false
# upload_sources: false
# push_translations: false
# upload_translations: false
# download_translations: false
# create_pull_request: false
# download_bundle: 6
# env:
# CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
# CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID }}

- name: Set mod_version
run: sed -i -E "s/(mod_version\s*=\s*).+/\1${{ env.MOD_VERSION }}/" gradle.properties

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

- name: Tag release on GitHub
uses: Kir-Antipov/mc-publish@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
files: CREDITS
name: 1.7.10-${{ env.MOD_VERSION }}
version: 1.7.10-${{ env.MOD_VERSION }}
github-tag: 1.7.10-${{ env.MOD_VERSION }}
github-commitish: ${{ github.sha }}
github-generate-changelog: true

- name: Publish Forge build to CurseForge and Modrinth
uses: Kir-Antipov/mc-publish@v3
with:
# TODO modrinth-id: MCF15nCy
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
# TODO curseforge-id: 1033985
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
files: |
build/libs/*-${{ env.MOD_VERSION }}.jar
name: Forge-1.7.10-${{ env.MOD_VERSION }}
version: Forge-1.7.10-${{ env.MOD_VERSION }}
changelog: |
Full changelog can be found on [GitHub](https://github.com/ThexXTURBOXx/Expanded-Armory-Legacy/releases)
loaders: forge
game-versions: 1.7.10
java: 8

0 comments on commit 04ae99d

Please sign in to comment.