Skip to content

Commit

Permalink
update ci (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
makeevrserg authored Jan 15, 2025
1 parent 35fd818 commit 75ef909
Show file tree
Hide file tree
Showing 12 changed files with 115 additions and 27 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/call-build-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ jobs:
build:
name: Build project with gradle
runs-on: ubuntu-latest
strategy:
matrix:
include:
- id: "bukkit"
task: ":instances:bukkit:build"
steps:
- name: Checkout Git repo
uses: actions/checkout@v4
Expand All @@ -18,4 +23,4 @@ jobs:
- name: Build with Gradle
uses: gradle/gradle-build-action@v3
with:
arguments: build --stacktrace
arguments: ${{ matrix.task }} --stacktrace
2 changes: 1 addition & 1 deletion .github/workflows/call-tests-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
- name: Run tests
uses: gradle/gradle-build-action@v3
with:
arguments: cleanTest test
arguments: test
36 changes: 36 additions & 0 deletions .github/workflows/call-upload-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Upload artifacts"
on:
workflow_call:
jobs:
upload_artifacts:
name: Build and upload
runs-on: ubuntu-latest
strategy:
matrix:
include:
- id: "bukkit"
task: ":instances:bukkit:shadowJar"
steps:
- name: Checkout Git repo
uses: actions/checkout@v4
- uses: christian-draeger/[email protected]
id: properties
with:
path: './gradle.properties'
properties: 'makeevrserg.project.name'
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 21
- name: Give gradle permission
run: chmod +x gradlew
- name: Build with Gradle ${{ matrix.id }}
uses: gradle/gradle-build-action@v3
with:
arguments: ${{ matrix.task }} --stacktrace
- uses: actions/upload-artifact@184d73b71b93c222403b2e7f1ffebe4508014249
name: "Upload ${{ matrix.id }}"
with:
name: ${{ matrix.id }}
path: ./jars/${{ steps.properties.outputs.makeevrserg-project-name }}-${{ matrix.id }}*.jar
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
name: "detekt-validation"
name: "Upload GitHub release"
on:
workflow_call:
secrets:
ACTIONS_TOKEN:
required: true
jobs:
publish:
name: Build and upload
upload_github_release:
name: Upload GitHub release
runs-on: ubuntu-latest
steps:
- name: Checkout Git repo
uses: actions/checkout@v4

- uses: christian-draeger/[email protected]
id: properties
with:
path: './gradle.properties'
properties: 'makeevrserg.project.name makeevrserg.project.version.string'
- name: Set up JDK 21
uses: actions/setup-java@v4

- uses: actions/download-artifact@d0ce8fd1167ed839810201de977912a090ab10a7
name: "Download bukkit"
with:
distribution: 'adopt'
java-version: 21
- name: Give gradle permission
run: chmod +x gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@v3
with:
arguments: :spigot:shadowJar --stacktrace
name: bukkit
path: ./jars

- name: Create release
id: create_internal_release
uses: softprops/action-gh-release@v2
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/call-upload-modrinth-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: "Upload Modrinth release"
on:
workflow_call:
secrets:
MODRINTH_TOKEN:
required: true
jobs:
upload_github_release:
name: Upload GitHub release
runs-on: ubuntu-latest
strategy:
matrix:
include:
- id: "bukkit"
task: ":instances:bukkit:shadowJar"
steps:
- name: Checkout Git repo
uses: actions/checkout@v4

- uses: christian-draeger/[email protected]
id: properties
with:
path: './gradle.properties'
properties: 'makeevrserg.project.name makeevrserg.project.version.string'

- uses: actions/download-artifact@d0ce8fd1167ed839810201de977912a090ab10a7
name: "Download ${{ matrix.id }}"
with:
name: ${{ matrix.id }}
path: ./jars/${{ matrix.id }}
- uses: Kir-Antipov/[email protected]
with:
# Only include this section if you wish to publish
# your assets on Modrinth.
modrinth-id: JodGTmt1
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
name: ${{ steps.properties.outputs.makeevrserg-project-name }}-${{ matrix.id }}
version: ${{ steps.properties.outputs.makeevrserg-project-version-string }}
changelog: ${{ join(github.event.commits.*.message, '\n') }}
version_type: beta
java: |
21
loaders: |
${{ matrix.id }}
game-versions: |
[1.16,1.21.1)
files: |
./jars/${{ matrix.id }}/*.jar
1 change: 0 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Check Develop
on:
merge_group:
pull_request:
branches:
- 'develop'
Expand Down
21 changes: 12 additions & 9 deletions .github/workflows/release-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@ on:
jobs:
gradle_validation:
uses: ./.github/workflows/call-gradle-wrapper-validation.yml
detekt_validation:
needs: gradle_validation
uses: ./.github/workflows/call-detekt-validation.yml
tests_validation:
needs: gradle_validation
uses: ./.github/workflows/call-tests-validation.yml
create_artifact:
needs: [ gradle_validation, detekt_validation, tests_validation ]
uses: ./.github/workflows/call-create-artifacts.yml
upload_artifacts:
needs: [ gradle_validation ]
uses: ./.github/workflows/call-upload-artifacts.yml
upload_github_artifacts:
needs: [ upload_artifacts ]
uses: ./.github/workflows/call-upload-github-release.yml
secrets:
ACTIONS_TOKEN: ${{ secrets.ACTIONS_TOKEN }}

upload_modrinth_artifacts:
needs: [ upload_artifacts ]
uses: ./.github/workflows/call-upload-modrinth-release.yml
secrets:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ astraShadowJar {
exclude(dependency("org.jetbrains.kotlin:kotlin-stdlib:${libs.versions.kotlin.version.get()}"))
}
archiveVersion.set(projectInfo.versionString)
archiveBaseName.set(projectInfo.name)
archiveBaseName.set("${projectInfo.name}-bukkit")
destinationDirectory.set(destination.get())
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ include(":modules:core-bukkit")
include(":modules:gui-bukkit")
include(":modules:periodic")
include(":modules:command-bukkit")
include(":spigot")
include(":instances:bukkit")

0 comments on commit 75ef909

Please sign in to comment.