mirror of
https://github.com/darksaid98/AlathranWars.git
synced 2026-12-03 22:15:24 +00:00
ci: add new workflows
This commit is contained in:
8 files changed
+193
-43
No files matched your search
@@ -0,0 +1,15 @@
|
|||||||
|
name: 'Setup Gradle'
|
||||||
|
description: 'Grant execute permissions and validate Gradle wrapper'
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: Grant execute permissions for Gradle wrapper
|
||||||
|
run: chmod +x gradlew
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Validate Gradle Wrapper Authenticity
|
||||||
|
uses: gradle/wrapper-validation-action@v1
|
||||||
|
|
||||||
|
- name: Setup Gradle and Caching
|
||||||
|
uses: gradle/gradle-build-action@v2
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
name: 'Setup JDK'
|
||||||
|
description: 'Set up JDK'
|
||||||
|
|
||||||
|
inputs:
|
||||||
|
java-version:
|
||||||
|
description: 'Java version'
|
||||||
|
required: true
|
||||||
|
default: '17'
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: 'composite'
|
||||||
|
steps:
|
||||||
|
- name: Setup JDK
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
java-version: ${{ inputs.java-version }}
|
||||||
|
distribution: 'temurin'
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
commit-message:
|
||||||
|
prefix: "ci:"
|
||||||
|
target-branch: "main"
|
||||||
|
- package-ecosystem: "gradle"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
|
commit-message:
|
||||||
|
prefix: "build:"
|
||||||
|
target-branch: "main"
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
name: Upload release assets
|
|
||||||
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [ published ]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
upload_asset:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
packages: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Validate Gradle Wrapper
|
|
||||||
uses: gradle/wrapper-validation-action@v1
|
|
||||||
|
|
||||||
- name: Setup Java
|
|
||||||
uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: temurin
|
|
||||||
cache: gradle
|
|
||||||
java-version: 17
|
|
||||||
|
|
||||||
- name: Clean Build
|
|
||||||
run: ./gradlew clean build --no-daemon
|
|
||||||
|
|
||||||
- name: Upload Release Assets
|
|
||||||
uses: AButler/[email protected]
|
|
||||||
with:
|
|
||||||
files: 'build/libs/AlathranWars-*.jar'
|
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
release-tag: ${{ github.event.release.tag_name }}
|
|
||||||
@@ -0,0 +1,93 @@
|
|||||||
|
name: Build & Upload Release jar with Gradle
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- 'master'
|
||||||
|
tags:
|
||||||
|
- '*'
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- 'main'
|
||||||
|
- 'master'
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * 6'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ format('{0}-{1}', github.job, github.ref) }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ ubuntu-latest ]
|
||||||
|
java: [ 17 ]
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: ./.github/actions/gradle
|
||||||
|
|
||||||
|
- name: Setup JDK
|
||||||
|
uses: ./.github/actions/jdk
|
||||||
|
with:
|
||||||
|
java-version: ${{ matrix.java }}
|
||||||
|
|
||||||
|
- name: Build with Gradle
|
||||||
|
run: ./gradlew clean build --info
|
||||||
|
|
||||||
|
- name: Upload build results
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ matrix.os }} Java ${{ matrix.java }} Snapshot
|
||||||
|
path: ${{ github.workspace }}/build/libs/
|
||||||
|
|
||||||
|
release:
|
||||||
|
needs:
|
||||||
|
- build
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
java: [ 17 ]
|
||||||
|
if: github.ref_type == 'tag' || ((github.ref_name == 'main' || github.ref_name == 'master') && github.event_name != 'schedule')
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Setup Gradle
|
||||||
|
uses: ./.github/actions/gradle
|
||||||
|
|
||||||
|
- name: Setup JDK
|
||||||
|
uses: ./.github/actions/jdk
|
||||||
|
with:
|
||||||
|
java-version: ${{ matrix.java }}
|
||||||
|
|
||||||
|
- name: Set Release Environment Variable
|
||||||
|
if: github.ref_type == 'tag'
|
||||||
|
run: |
|
||||||
|
echo "CUSTOM_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build with Gradle
|
||||||
|
if: github.ref_type != 'tag'
|
||||||
|
run: ./gradlew clean build
|
||||||
|
|
||||||
|
- name: Build with Gradle
|
||||||
|
if: github.ref_type == 'tag'
|
||||||
|
run: ./gradlew clean build -PcustomVersion=${{ env.CUSTOM_VERSION }}
|
||||||
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
id: release
|
||||||
|
if: github.ref_type == 'tag'
|
||||||
|
with:
|
||||||
|
name: ${{ format('Release {0}', github.ref_name) }}
|
||||||
|
files: ${{ github.workspace }}/build/libs/*
|
||||||
|
prerelease: ${{ contains(github.ref_name, '-RC-') }}
|
||||||
|
generate_release_notes: true
|
||||||
|
fail_on_unmatched_files: true
|
||||||
|
draft: false
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
name: 'Close Stale Issues & PRs'
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '30 1 * * *'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
stale:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v8
|
||||||
|
with:
|
||||||
|
stale-issue-message: ' This issue has been automatically marked as stale because it has been open for 60 days with no activity.'
|
||||||
|
stale-pr-message: 'This PR has been automatically marked as stale because it has been open for 60 days with no activity.'
|
||||||
|
close-issue-message: 'This issue was closed because it has been stalled for -1 days with no activity.'
|
||||||
|
close-pr-message: 'This PR was closed because it has been stalled for -1 days with no activity.'
|
||||||
|
days-before-issue-stale: 60
|
||||||
|
days-before-pr-stale: 60
|
||||||
|
days-before-issue-close: -1
|
||||||
|
days-before-pr-close: -1
|
||||||
|
stale-issue-label: 'stale'
|
||||||
|
stale-pr-label: 'stale'
|
||||||
+21
-7
@@ -5,14 +5,18 @@ plugins {
|
|||||||
id("xyz.jpenilla.run-paper") version "2.1.0" // Adds runServer and runMojangMappedServer tasks for testing
|
id("xyz.jpenilla.run-paper") version "2.1.0" // Adds runServer and runMojangMappedServer tasks for testing
|
||||||
id("net.minecrell.plugin-yml.bukkit") version "0.6.0" // Automatic plugin.yml generation
|
id("net.minecrell.plugin-yml.bukkit") version "0.6.0" // Automatic plugin.yml generation
|
||||||
id("io.papermc.paperweight.userdev") version "1.5.5" // Used to develop internal plugins using Mojang mappings
|
id("io.papermc.paperweight.userdev") version "1.5.5" // Used to develop internal plugins using Mojang mappings
|
||||||
|
|
||||||
|
eclipse
|
||||||
|
idea
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "com.github.alathra.AlathranWars"
|
group = "com.github.alathra"
|
||||||
version = "3.0.0-SNAPSHOT-7"
|
version = "3.0.0-RC-1"
|
||||||
description = ""
|
description = ""
|
||||||
|
val mainPackage = "${project.group}.${rootProject.name}"
|
||||||
|
|
||||||
java {
|
java {
|
||||||
toolchain.languageVersion.set(JavaLanguageVersion.of(17)) // Configure the java toolchain. This allows gradle to auto-provision JDK 17 on systems that only have JDK 8 installed for example.
|
toolchain.languageVersion.set(JavaLanguageVersion.of(JavaVersion.VERSION_17.majorVersion)) // Configure the java toolchain. This allows gradle to auto-provision JDK 17 on systems that only have JDK 8 installed for example.
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -122,13 +126,13 @@ tasks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bukkit {
|
bukkit { // Options: https://github.com/Minecrell/plugin-yml#bukkit
|
||||||
// Plugin main class (required)
|
// Plugin main class (required)
|
||||||
main = "${project.group}.Main"
|
main = "${mainPackage}.${rootProject.name}"
|
||||||
|
|
||||||
// Plugin Information
|
// Plugin Information
|
||||||
name = project.name
|
name = project.name
|
||||||
prefix = "AlathranWars"
|
prefix = project.name
|
||||||
version = "${project.version}"
|
version = "${project.version}"
|
||||||
description = "${project.description}"
|
description = "${project.description}"
|
||||||
authors = listOf("darksaid98", "ShermansWorld", "NinjaMandalorian", "AubriTheHuman")
|
authors = listOf("darksaid98", "ShermansWorld", "NinjaMandalorian", "AubriTheHuman")
|
||||||
@@ -139,4 +143,14 @@ bukkit {
|
|||||||
load = net.minecrell.pluginyml.bukkit.BukkitPluginDescription.PluginLoadOrder.POSTWORLD // STARTUP or POSTWORLD
|
load = net.minecrell.pluginyml.bukkit.BukkitPluginDescription.PluginLoadOrder.POSTWORLD // STARTUP or POSTWORLD
|
||||||
depend = listOf("Vault", "Towny")
|
depend = listOf("Vault", "Towny")
|
||||||
softDepend = listOf("TAB", "Skulls", "HeadsPlus")
|
softDepend = listOf("TAB", "Skulls", "HeadsPlus")
|
||||||
}
|
}// Apply custom version arg
|
||||||
|
val versionArg = if (hasProperty("customVersion"))
|
||||||
|
(properties["customVersion"] as String).uppercase() // Uppercase version string
|
||||||
|
else
|
||||||
|
"${project.version}-SNAPSHOT-${Instant.now().epochSecond}" // Append snapshot to version
|
||||||
|
|
||||||
|
// Strip prefixed "v" from version tag
|
||||||
|
project.version = if (versionArg.first().equals('v', true))
|
||||||
|
versionArg.substring(1)
|
||||||
|
else
|
||||||
|
versionArg.uppercase()
|
||||||
@@ -1,7 +1,12 @@
|
|||||||
pluginManagement {
|
pluginManagement {
|
||||||
repositories {
|
repositories {
|
||||||
gradlePluginPortal()
|
gradlePluginPortal()
|
||||||
|
mavenCentral()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("org.gradle.toolchains.foojay-resolver-convention") version("0.7.0")
|
||||||
|
}
|
||||||
|
|
||||||
rootProject.name = "AlathranWars"
|
rootProject.name = "AlathranWars"
|
||||||
Reference in new issue
Block a user