Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/build-dummy.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
name: Build Dummy
name: CI Build (Dummy)

on:
pull_request:
branches: [ main ]
branches: [ "main" ]
paths-ignore:
- 'CreatePop/**'
- '.github/workflows/build.yml'

jobs:
noop:
build:
runs-on: ubuntu-latest
steps:
- run: echo "Dummy workflow placeholder for branch protection compatibility."

- name: Bypass CI
run: echo "No code changes detected. Bypassing build."
53 changes: 38 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,47 @@
name: Build
name: CI Build

on:
pull_request:
branches: [ main ]
branches: [ "main" ]
paths:
- 'CreatePop/**'
- '.github/workflows/build.yml'

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- uses: gradle/actions/setup-gradle@v3
- name: Build
run: ./gradlew build
- name: Upload jar
uses: actions/upload-artifact@v4
with:
name: createpop-jar
path: build/libs/*.jar
- name: Checkout Repository
uses: actions/checkout@v4

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

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Make gradlew executable
working-directory: ./CreatePop
run: chmod +x ./gradlew

- name: Build with Gradle
working-directory: ./CreatePop
run: ./gradlew build

- name: Determine Primary Jar
working-directory: ./CreatePop/build/libs
run: |
PRIMARY_JAR=$(ls *.jar | grep -vE -- '-sources|-dev|-api|-slim' | head -n 1)
echo "JAR_FILENAME=$PRIMARY_JAR" >> $GITHUB_ENV
echo "ARTIFACT_NAME=${PRIMARY_JAR%.jar}" >> $GITHUB_ENV

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: CreatePop/build/libs/${{ env.JAR_FILENAME }}
if-no-files-found: error
66 changes: 52 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Release Mod

on:
push:
Expand All @@ -7,20 +7,58 @@ on:
workflow_dispatch:

jobs:
release:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
contents: write # Required for creating GitHub Releases

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '21'
- uses: gradle/actions/setup-gradle@v3
- run: ./gradlew build
- name: Publish GitHub release
uses: softprops/action-gh-release@v2
with:
files: build/libs/*.jar
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for the changelog builder to read commit history

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

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Make gradlew executable
working-directory: ./CreatePop
run: chmod +x ./gradlew

- name: Build Mod
working-directory: ./CreatePop
run: ./gradlew build

- name: Generate Changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Release
uses: Kir-Antipov/mc-publish@v3.3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# Uncomment and configure these when ready to push to Modrinth/CurseForge
# modrinth-id: YOUR_MODRINTH_PROJECT_ID
# modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
# curseforge-id: YOUR_CURSEFORGE_PROJECT_ID
# curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

# Grabs the compiled jar, ignoring dev/sources jars
files: CreatePop/build/libs/!(*-dev|-sources).jar

name: "Create: Pop ${{ github.ref_name }}"
version: ${{ github.ref_name }}
version-type: release
changelog: ${{ steps.changelog.outputs.changelog }}

loaders: neoforge
game-versions: 1.21.1
Loading