mirror of
https://github.com/System-End/Discord-MC-Chat.git
synced 2026-04-19 19:45:14 +00:00
workflow
This commit is contained in:
parent
01cc07d68b
commit
3be41e36f2
3 changed files with 46 additions and 0 deletions
34
.github/workflows/build.yml
vendored
Normal file
34
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
name: build
|
||||
on: [ pull_request, push ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: 21
|
||||
- name: Validate Gradle Wrapper
|
||||
uses: gradle/actions/wrapper-validation@v4
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@v4
|
||||
- name: Make Gradle Wrapper Executable
|
||||
run: chmod +x ./gradlew
|
||||
- name: Clean
|
||||
run: ./gradlew clean
|
||||
- name: Build
|
||||
run: ./gradlew build
|
||||
- name: Get Short Commit Hash
|
||||
id: get_short_commit_hash
|
||||
run: |
|
||||
short_sha=$(echo ${GITHUB_SHA} | cut -c1-7)
|
||||
echo "short_sha=$short_sha" >> $GITHUB_OUTPUT
|
||||
- name: Upload Build Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Discord-MC-Chat ${{ steps.get_short_commit_hash.outputs.short_sha }}
|
||||
path: build/*.jar
|
||||
|
|
@ -25,3 +25,7 @@ subprojects {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
project.afterEvaluate {
|
||||
delete file("build")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,4 +83,12 @@ tasks.register("mergeJars") {
|
|||
build {
|
||||
dependsOn shadowJar
|
||||
dependsOn tasks.named("mergeJars")
|
||||
|
||||
doLast {
|
||||
copy {
|
||||
from "build/libs"
|
||||
into "../build"
|
||||
exclude "*common*"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue