mirror of
https://github.com/FancyInnovations/FancyPlugins.git
synced 2025-12-06 07:43:36 +00:00
Compare commits
2 Commits
54572f1736
...
e837ad89d3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e837ad89d3 | ||
|
|
47bb6f7a10 |
@@ -2,8 +2,9 @@ name: Deploy FancyDialogs (release)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-plugin:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -27,25 +28,20 @@ jobs:
|
|||||||
- name: Modify gradlew permissions
|
- name: Modify gradlew permissions
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
- name: Build deployment tool
|
- name: Build
|
||||||
run: ./gradlew :tools:deployment:shadowJar
|
|
||||||
|
|
||||||
- name: Build FancyDialogs for Modrinth
|
|
||||||
env:
|
env:
|
||||||
RELEASE_CHANNEL: 'release'
|
RELEASE_CHANNEL: 'release'
|
||||||
RELEASE_PLATFORM: 'modrinth'
|
|
||||||
run: ./gradlew :plugins:fancydialogs:shadowJar
|
run: ./gradlew :plugins:fancydialogs:shadowJar
|
||||||
|
|
||||||
- name: Deploy to Modrinth
|
- name: Deploy
|
||||||
env:
|
uses: fancyinnovations/fancyverteiler@main
|
||||||
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }}
|
with:
|
||||||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
config_path: "/plugins/fancydialogs/release_deployment_config.json"
|
||||||
run:
|
modrinth_api_key: ${{ secrets.MODRINTH_API_KEY }}
|
||||||
cd tools/deployment/build/libs &&
|
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
java -jar deployment.jar modrinth ../../../../plugins/fancydialogs/release_deployment_config.json true
|
|
||||||
|
|
||||||
- name: Publish to reposilite (releases)
|
# - name: Publish to reposilite (releases)
|
||||||
run: ./gradlew :plugins:fancydialogs:fd-api:publishAllPublicationsToFancyinnovationsReleasesRepository
|
# run: ./gradlew :plugins:fancydialogs:fd-api:publishAllPublicationsToFancyinnovationsReleasesRepository
|
||||||
|
|
||||||
- name: Publish to reposilite (snapshots)
|
# - name: Publish to reposilite (snapshots)
|
||||||
run: ./gradlew :plugins:fancydialogs:fd-api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
# run: ./gradlew :plugins:fancydialogs:fd-api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
||||||
@@ -2,8 +2,9 @@ name: Deploy FancyHolograms v2 (release)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-plugin:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -27,25 +28,20 @@ jobs:
|
|||||||
- name: Modify gradlew permissions
|
- name: Modify gradlew permissions
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
- name: Build deployment tool
|
- name: Build
|
||||||
run: ./gradlew :tools:deployment:shadowJar
|
|
||||||
|
|
||||||
- name: Build FancyHolograms v2 for Modrinth
|
|
||||||
env:
|
env:
|
||||||
RELEASE_CHANNEL: 'release'
|
RELEASE_CHANNEL: 'release'
|
||||||
RELEASE_PLATFORM: 'modrinth'
|
|
||||||
run: ./gradlew :plugins:fancyholograms-v2:shadowJar
|
run: ./gradlew :plugins:fancyholograms-v2:shadowJar
|
||||||
|
|
||||||
- name: Deploy to Modrinth
|
- name: Deploy
|
||||||
env:
|
uses: fancyinnovations/fancyverteiler@main
|
||||||
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }}
|
with:
|
||||||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
config_path: "/plugins/fancyholograms-v2/release_deployment_config.json"
|
||||||
run:
|
modrinth_api_key: ${{ secrets.MODRINTH_API_KEY }}
|
||||||
cd tools/deployment/build/libs &&
|
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
java -jar deployment.jar modrinth ../../../../plugins/fancyholograms-v2/release_deployment_config.json true
|
|
||||||
|
|
||||||
- name: Publish to reposilite (releases)
|
# - name: Publish to reposilite (releases)
|
||||||
run: ./gradlew :plugins:fancyholograms-v2:api:publishAllPublicationsToFancyinnovationsReleasesRepository
|
# run: ./gradlew :plugins:fancyholograms-v2:api:publishAllPublicationsToFancyinnovationsReleasesRepository
|
||||||
|
|
||||||
- name: Publish to reposilite (snapshots)
|
# - name: Publish to reposilite (snapshots)
|
||||||
run: ./gradlew :plugins:fancyholograms-v2:api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
# run: ./gradlew :plugins:fancyholograms-v2:api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
||||||
@@ -2,8 +2,9 @@ name: Deploy FancyHolograms (release)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-plugin:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -27,25 +28,20 @@ jobs:
|
|||||||
- name: Modify gradlew permissions
|
- name: Modify gradlew permissions
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
- name: Build deployment tool
|
- name: Build
|
||||||
run: ./gradlew :tools:deployment:shadowJar
|
|
||||||
|
|
||||||
- name: Build FancyHolograms for Modrinth
|
|
||||||
env:
|
env:
|
||||||
RELEASE_CHANNEL: 'release'
|
RELEASE_CHANNEL: 'release'
|
||||||
RELEASE_PLATFORM: 'modrinth'
|
|
||||||
run: ./gradlew :plugins:fancyholograms:shadowJar
|
run: ./gradlew :plugins:fancyholograms:shadowJar
|
||||||
|
|
||||||
- name: Deploy to Modrinth
|
- name: Deploy
|
||||||
env:
|
uses: fancyinnovations/fancyverteiler@main
|
||||||
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }}
|
with:
|
||||||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
config_path: "/plugins/fancyholograms/release_deployment_config.json"
|
||||||
run:
|
modrinth_api_key: ${{ secrets.MODRINTH_API_KEY }}
|
||||||
cd tools/deployment/build/libs &&
|
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
java -jar deployment.jar modrinth ../../../../plugins/fancyholograms/release_deployment_config.json true
|
|
||||||
|
|
||||||
- name: Publish to reposilite (releases)
|
# - name: Publish to reposilite (releases)
|
||||||
run: ./gradlew :plugins:fancyholograms:fh-api:publishAllPublicationsToFancyinnovationsReleasesRepository
|
# run: ./gradlew :plugins:fancyholograms:fh-api:publishAllPublicationsToFancyinnovationsReleasesRepository
|
||||||
|
|
||||||
- name: Publish to reposilite (snapshots)
|
# - name: Publish to reposilite (snapshots)
|
||||||
run: ./gradlew :plugins:fancyholograms:fh-api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
# run: ./gradlew :plugins:fancyholograms:fh-api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
||||||
30
.github/workflows/deploy-release-fancynpcs.yml
vendored
30
.github/workflows/deploy-release-fancynpcs.yml
vendored
@@ -2,8 +2,9 @@ name: Deploy FancyNpcs (release)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-plugin:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -27,25 +28,20 @@ jobs:
|
|||||||
- name: Modify gradlew permissions
|
- name: Modify gradlew permissions
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
- name: Build deployment tool
|
- name: Build
|
||||||
run: ./gradlew :tools:deployment:shadowJar
|
|
||||||
|
|
||||||
- name: Build FancyNpcs for Modrinth
|
|
||||||
env:
|
env:
|
||||||
RELEASE_CHANNEL: 'release'
|
RELEASE_CHANNEL: 'release'
|
||||||
RELEASE_PLATFORM: 'modrinth'
|
|
||||||
run: ./gradlew :plugins:fancynpcs:shadowJar
|
run: ./gradlew :plugins:fancynpcs:shadowJar
|
||||||
|
|
||||||
- name: Deploy to Modrinth
|
- name: Deploy
|
||||||
env:
|
uses: fancyinnovations/fancyverteiler@main
|
||||||
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }}
|
with:
|
||||||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
config_path: "/plugins/fancynpcs/release_deployment_config.json"
|
||||||
run:
|
modrinth_api_key: ${{ secrets.MODRINTH_API_KEY }}
|
||||||
cd tools/deployment/build/libs &&
|
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
java -jar deployment.jar modrinth ../../../../plugins/fancynpcs/release_deployment_config.json true
|
|
||||||
|
|
||||||
- name: Publish to reposilite (releases)
|
# - name: Publish to reposilite (releases)
|
||||||
run: ./gradlew :plugins:fancynpcs:fn-api:publishAllPublicationsToFancyinnovationsReleasesRepository
|
# run: ./gradlew :plugins:fancynpcs:fn-api:publishAllPublicationsToFancyinnovationsReleasesRepository
|
||||||
|
|
||||||
- name: Publish to reposilite (snapshots)
|
# - name: Publish to reposilite (snapshots)
|
||||||
run: ./gradlew :plugins:fancynpcs:fn-api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
# run: ./gradlew :plugins:fancynpcs:fn-api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
||||||
@@ -2,8 +2,9 @@ name: Deploy FancyDialogs (snapshot)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-fancydialogs:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -27,22 +28,17 @@ jobs:
|
|||||||
- name: Modify gradlew permissions
|
- name: Modify gradlew permissions
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
- name: Build deployment tool
|
- name: Build
|
||||||
run: ./gradlew :tools:deployment:shadowJar
|
|
||||||
|
|
||||||
- name: Build FancyDialogs for Modrinth
|
|
||||||
env:
|
env:
|
||||||
RELEASE_CHANNEL: 'snapshot'
|
RELEASE_CHANNEL: 'snapshot'
|
||||||
RELEASE_PLATFORM: 'modrinth'
|
|
||||||
run: ./gradlew :plugins:fancydialogs:shadowJar
|
run: ./gradlew :plugins:fancydialogs:shadowJar
|
||||||
|
|
||||||
- name: Deploy to Modrinth
|
- name: Deploy
|
||||||
env:
|
uses: fancyinnovations/fancyverteiler@main
|
||||||
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }}
|
with:
|
||||||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
config_path: "/plugins/fancydialogs/snapshot_deployment_config.json"
|
||||||
run:
|
modrinth_api_key: ${{ secrets.MODRINTH_API_KEY }}
|
||||||
cd tools/deployment/build/libs &&
|
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
java -jar deployment.jar modrinth ../../../../plugins/fancydialogs/snapshot_deployment_config.json true
|
|
||||||
|
|
||||||
- name: Publish to reposilite (snapshots)
|
# - name: Publish to reposilite (snapshots)
|
||||||
run: ./gradlew :plugins:fancydialogs:fd-api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
# run: ./gradlew :plugins:fancydialogs:fd-api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
||||||
@@ -2,8 +2,9 @@ name: Deploy FancyHolograms v2 (snapshot)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-fancyholograms:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -27,22 +28,17 @@ jobs:
|
|||||||
- name: Modify gradlew permissions
|
- name: Modify gradlew permissions
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
- name: Build deployment tool
|
- name: Build
|
||||||
run: ./gradlew :tools:deployment:shadowJar
|
|
||||||
|
|
||||||
- name: Build FancyHolograms v2 for Modrinth
|
|
||||||
env:
|
env:
|
||||||
RELEASE_CHANNEL: 'snapshot'
|
RELEASE_CHANNEL: 'snapshot'
|
||||||
RELEASE_PLATFORM: 'modrinth'
|
|
||||||
run: ./gradlew :plugins:fancyholograms-v2:shadowJar
|
run: ./gradlew :plugins:fancyholograms-v2:shadowJar
|
||||||
|
|
||||||
- name: Deploy to Modrinth
|
- name: Deploy
|
||||||
env:
|
uses: fancyinnovations/fancyverteiler@main
|
||||||
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }}
|
with:
|
||||||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
config_path: "/plugins/fancyholograms-v2/snapshot_deployment_config.json"
|
||||||
run:
|
modrinth_api_key: ${{ secrets.MODRINTH_API_KEY }}
|
||||||
cd tools/deployment/build/libs &&
|
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
java -jar deployment.jar modrinth ../../../../plugins/fancyholograms-v2/snapshot_deployment_config.json true
|
|
||||||
|
|
||||||
- name: Publish to reposilite (snapshots)
|
# - name: Publish to reposilite (snapshots)
|
||||||
run: ./gradlew :plugins:fancyholograms-v2:api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
# run: ./gradlew :plugins:fancyholograms-v2:api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
||||||
@@ -2,8 +2,9 @@ name: Deploy FancyHolograms (snapshot)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-plugin:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -27,22 +28,17 @@ jobs:
|
|||||||
- name: Modify gradlew permissions
|
- name: Modify gradlew permissions
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
- name: Build deployment tool
|
- name: Build
|
||||||
run: ./gradlew :tools:deployment:shadowJar
|
|
||||||
|
|
||||||
- name: Build FancyHolograms for Modrinth
|
|
||||||
env:
|
env:
|
||||||
RELEASE_CHANNEL: 'snapshot'
|
RELEASE_CHANNEL: 'snapshot'
|
||||||
RELEASE_PLATFORM: 'modrinth'
|
|
||||||
run: ./gradlew :plugins:fancyholograms:shadowJar
|
run: ./gradlew :plugins:fancyholograms:shadowJar
|
||||||
|
|
||||||
- name: Deploy to Modrinth
|
- name: Deploy
|
||||||
env:
|
uses: fancyinnovations/fancyverteiler@main
|
||||||
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }}
|
with:
|
||||||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
config_path: "/plugins/fancyholograms/snapshot_deployment_config.json"
|
||||||
run:
|
modrinth_api_key: ${{ secrets.MODRINTH_API_KEY }}
|
||||||
cd tools/deployment/build/libs &&
|
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
java -jar deployment.jar modrinth ../../../../plugins/fancyholograms/snapshot_deployment_config.json true
|
|
||||||
|
|
||||||
- name: Publish to reposilite (snapshots)
|
# - name: Publish to reposilite (snapshots)
|
||||||
run: ./gradlew :plugins:fancyholograms:fh-api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
# run: ./gradlew :plugins:fancyholograms:fh-api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
||||||
40
.github/workflows/deploy-snapshot-fancynpcs.yml
vendored
40
.github/workflows/deploy-snapshot-fancynpcs.yml
vendored
@@ -2,8 +2,9 @@ name: Deploy FancyNpcs (snapshot)
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy-plugin:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -27,36 +28,17 @@ jobs:
|
|||||||
- name: Modify gradlew permissions
|
- name: Modify gradlew permissions
|
||||||
run: chmod +x ./gradlew
|
run: chmod +x ./gradlew
|
||||||
|
|
||||||
- name: Build deployment tool
|
- name: Build
|
||||||
run: ./gradlew :tools:deployment:shadowJar
|
|
||||||
|
|
||||||
- name: Build FancyNpcs for Modrinth
|
|
||||||
env:
|
env:
|
||||||
RELEASE_CHANNEL: 'snapshot'
|
RELEASE_CHANNEL: 'snapshot'
|
||||||
RELEASE_PLATFORM: 'modrinth'
|
|
||||||
run: ./gradlew :plugins:fancynpcs:shadowJar
|
run: ./gradlew :plugins:fancynpcs:shadowJar
|
||||||
|
|
||||||
- name: Deploy to Modrinth
|
- name: Deploy
|
||||||
env:
|
uses: fancyinnovations/fancyverteiler@main
|
||||||
MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }}
|
with:
|
||||||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
config_path: "/plugins/fancynpcs/snapshot_deployment_config.json"
|
||||||
run:
|
modrinth_api_key: ${{ secrets.MODRINTH_API_KEY }}
|
||||||
cd tools/deployment/build/libs &&
|
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
||||||
java -jar deployment.jar modrinth ../../../../plugins/fancynpcs/snapshot_deployment_config.json true
|
|
||||||
|
|
||||||
# - name: Build FancyNpcs for Hangar
|
# - name: Publish to reposilite (snapshots)
|
||||||
# env:
|
# run: ./gradlew :plugins:fancynpcs:fn-api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
||||||
# RELEASE_CHANNEL: 'snapshot'
|
|
||||||
# RELEASE_PLATFORM: 'hangar'
|
|
||||||
# run: ./gradlew :plugins:fancynpcs:shadowJar
|
|
||||||
#
|
|
||||||
# - name: Deploy to Hangar
|
|
||||||
# env:
|
|
||||||
# HANGAR_API_KEY: "${{ secrets.HANGAR_API_KEY }}"
|
|
||||||
# DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
|
|
||||||
# run:
|
|
||||||
# cd tools/deployment/build/libs &&
|
|
||||||
# java -jar deployment.jar hangar ../../../../plugins/fancynpcs/snapshot_deployment_config.json true
|
|
||||||
|
|
||||||
- name: Publish to reposilite (snapshots)
|
|
||||||
run: ./gradlew :plugins:fancynpcs:fn-api:publishAllPublicationsToFancyinnovationsSnapshotsRepository
|
|
||||||
@@ -35,7 +35,6 @@ This is a [monorepo](docs/src/development-guidelines/monorepo.md) for all plugin
|
|||||||
- Packets: packet handling library (also called FancySitula)
|
- Packets: packet handling library (also called FancySitula)
|
||||||
|
|
||||||
**Tools:**
|
**Tools:**
|
||||||
- Deployment: deploy plugins to platforms like modrinth
|
|
||||||
- Quick E2E: generate a quick end-to-end environment for testing
|
- Quick E2E: generate a quick end-to-end environment for testing
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|||||||
@@ -1,21 +1,23 @@
|
|||||||
{
|
{
|
||||||
"project_name": "FancyDialogs",
|
"project_name": "FancyDialogs",
|
||||||
"project_id": "Sx6YwpnK",
|
"plugin_jar_path": "/plugins/fancydialogs/build/libs/FancyDialogs-%VERSION%.jar",
|
||||||
"plugin_jar_path": "../../../../plugins/fancydialogs/build/libs/FancyDialogs-%VERSION%.jar",
|
"changelog_path": "/plugins/fancydialogs/CHANGELOG.md",
|
||||||
"changelog_path": "../../../../plugins/fancydialogs/CHANGELOG.md",
|
"version_path": "/plugins/fancydialogs/VERSION",
|
||||||
"version_path": "../../../../plugins/fancydialogs/VERSION",
|
"modrinth": {
|
||||||
"supported_versions": [
|
"project_id": "Sx6YwpnK",
|
||||||
"1.21.6",
|
"supported_versions": [
|
||||||
"1.21.7",
|
"1.21.6",
|
||||||
"1.21.8",
|
"1.21.7",
|
||||||
"1.21.9",
|
"1.21.8",
|
||||||
"1.21.10",
|
"1.21.9",
|
||||||
"1.21.11"
|
"1.21.10",
|
||||||
],
|
"1.21.11"
|
||||||
"channel": "RELEASE",
|
],
|
||||||
"loaders": [
|
"channel": "release",
|
||||||
"paper",
|
"loaders": [
|
||||||
"folia"
|
"paper",
|
||||||
],
|
"folia"
|
||||||
"featured": true
|
],
|
||||||
|
"featured": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,21 +1,23 @@
|
|||||||
{
|
{
|
||||||
"project_name": "FancyDialogs",
|
"project_name": "FancyDialogs",
|
||||||
"project_id": "Sx6YwpnK",
|
"plugin_jar_path": "/plugins/fancydialogs/build/libs/FancyDialogs-%VERSION%.jar",
|
||||||
"plugin_jar_path": "../../../../plugins/fancydialogs/build/libs/FancyDialogs-%VERSION%.jar",
|
"changelog_path": "/plugins/fancydialogs/CHANGELOG-SNAPSHOT.md",
|
||||||
"changelog_path": "../../../../plugins/fancydialogs/CHANGELOG-SNAPSHOT.md",
|
"version_path": "/plugins/fancydialogs/VERSION",
|
||||||
"version_path": "../../../../plugins/fancydialogs/VERSION",
|
"modrinth": {
|
||||||
"supported_versions": [
|
"project_id": "Sx6YwpnK",
|
||||||
"1.21.6",
|
"supported_versions": [
|
||||||
"1.21.7",
|
"1.21.6",
|
||||||
"1.21.8",
|
"1.21.7",
|
||||||
"1.21.9",
|
"1.21.8",
|
||||||
"1.21.10",
|
"1.21.9",
|
||||||
"1.21.11-pre4"
|
"1.21.10",
|
||||||
],
|
"1.21.11-pre4"
|
||||||
"channel": "BETA",
|
],
|
||||||
"loaders": [
|
"channel": "beta",
|
||||||
"paper",
|
"loaders": [
|
||||||
"folia"
|
"paper",
|
||||||
],
|
"folia"
|
||||||
"featured": false
|
],
|
||||||
|
"featured": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,34 +1,36 @@
|
|||||||
{
|
{
|
||||||
"project_name": "FancyHolograms",
|
"project_name": "FancyHolograms",
|
||||||
"project_id": "5QNgOj66",
|
"plugin_jar_path": "/plugins/fancyholograms-v2/build/libs/FancyHolograms-%VERSION%.jar",
|
||||||
"plugin_jar_path": "../../../../plugins/fancyholograms-v2/build/libs/FancyHolograms-%VERSION%.jar",
|
"changelog_path": "/plugins/fancyholograms-v2/CHANGELOG.md",
|
||||||
"changelog_path": "../../../../plugins/fancyholograms-v2/CHANGELOG.md",
|
"version_path": "/plugins/fancyholograms-v2/VERSION",
|
||||||
"version_path": "../../../../plugins/fancyholograms-v2/VERSION",
|
"modrinth": {
|
||||||
"supported_versions": [
|
"project_id": "5QNgOj66",
|
||||||
"1.20",
|
"supported_versions": [
|
||||||
"1.20.1",
|
"1.20",
|
||||||
"1.20.2",
|
"1.20.1",
|
||||||
"1.20.3",
|
"1.20.2",
|
||||||
"1.20.4",
|
"1.20.3",
|
||||||
"1.20.5",
|
"1.20.4",
|
||||||
"1.20.6",
|
"1.20.5",
|
||||||
"1.21",
|
"1.20.6",
|
||||||
"1.21.1",
|
"1.21",
|
||||||
"1.21.2",
|
"1.21.1",
|
||||||
"1.21.3",
|
"1.21.2",
|
||||||
"1.21.4",
|
"1.21.3",
|
||||||
"1.21.5",
|
"1.21.4",
|
||||||
"1.21.6",
|
"1.21.5",
|
||||||
"1.21.7",
|
"1.21.6",
|
||||||
"1.21.8",
|
"1.21.7",
|
||||||
"1.21.9",
|
"1.21.8",
|
||||||
"1.21.10",
|
"1.21.9",
|
||||||
"1.21.11"
|
"1.21.10",
|
||||||
],
|
"1.21.11"
|
||||||
"channel": "RELEASE",
|
],
|
||||||
"loaders": [
|
"channel": "release",
|
||||||
"paper",
|
"loaders": [
|
||||||
"folia"
|
"paper",
|
||||||
],
|
"folia"
|
||||||
"featured": true
|
],
|
||||||
|
"featured": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,34 +1,36 @@
|
|||||||
{
|
{
|
||||||
"project_name": "FancyHolograms",
|
"project_name": "FancyHolograms",
|
||||||
"project_id": "5QNgOj66",
|
"plugin_jar_path": "/plugins/fancyholograms-v2/build/libs/FancyHolograms-%VERSION%.jar",
|
||||||
"plugin_jar_path": "../../../../plugins/fancyholograms-v2/build/libs/FancyHolograms-%VERSION%.jar",
|
"changelog_path": "/plugins/fancyholograms-v2/CHANGELOG-SNAPSHOT.md",
|
||||||
"changelog_path": "../../../../plugins/fancyholograms-v2/CHANGELOG-SNAPSHOT.md",
|
"version_path": "/plugins/fancyholograms-v2/VERSION",
|
||||||
"version_path": "../../../../plugins/fancyholograms-v2/VERSION",
|
"modrinth": {
|
||||||
"supported_versions": [
|
"project_id": "5QNgOj66",
|
||||||
"1.20",
|
"supported_versions": [
|
||||||
"1.20.1",
|
"1.20",
|
||||||
"1.20.2",
|
"1.20.1",
|
||||||
"1.20.3",
|
"1.20.2",
|
||||||
"1.20.4",
|
"1.20.3",
|
||||||
"1.20.5",
|
"1.20.4",
|
||||||
"1.20.6",
|
"1.20.5",
|
||||||
"1.21",
|
"1.20.6",
|
||||||
"1.21.1",
|
"1.21",
|
||||||
"1.21.2",
|
"1.21.1",
|
||||||
"1.21.3",
|
"1.21.2",
|
||||||
"1.21.4",
|
"1.21.3",
|
||||||
"1.21.5",
|
"1.21.4",
|
||||||
"1.21.6",
|
"1.21.5",
|
||||||
"1.21.7",
|
"1.21.6",
|
||||||
"1.21.8",
|
"1.21.7",
|
||||||
"1.21.9",
|
"1.21.8",
|
||||||
"1.21.10",
|
"1.21.9",
|
||||||
"1.21.11-pre4"
|
"1.21.10",
|
||||||
],
|
"1.21.11-pre4"
|
||||||
"channel": "BETA",
|
],
|
||||||
"loaders": [
|
"channel": "beta",
|
||||||
"paper",
|
"loaders": [
|
||||||
"folia"
|
"paper",
|
||||||
],
|
"folia"
|
||||||
"featured": false
|
],
|
||||||
|
"featured": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,30 +1,31 @@
|
|||||||
{
|
{
|
||||||
"project_name": "FancyHolograms",
|
"project_name": "FancyHolograms",
|
||||||
"project_id": "5QNgOj66",
|
"plugin_jar_path": "/plugins/fancyholograms/build/libs/FancyHolograms-%VERSION%.jar",
|
||||||
"plugin_jar_path": "../../../../plugins/fancyholograms/build/libs/FancyHolograms-%VERSION%.jar",
|
"changelog_path": "/plugins/fancyholograms/CHANGELOG.md",
|
||||||
"changelog_path": "../../../../plugins/fancyholograms/CHANGELOG.md",
|
"version_path": "/plugins/fancyholograms/VERSION",
|
||||||
"version_path": "../../../../plugins/fancyholograms/VERSION",
|
"modrinth": {
|
||||||
"supported_versions": [
|
"project_id": "5QNgOj66",
|
||||||
"1.20.5",
|
"supported_versions": [
|
||||||
"1.20.6",
|
"1.20.5",
|
||||||
"1.21",
|
"1.20.6",
|
||||||
"1.21.1",
|
"1.21",
|
||||||
"1.21.2",
|
"1.21.1",
|
||||||
"1.21.3",
|
"1.21.2",
|
||||||
"1.21.4",
|
"1.21.3",
|
||||||
"1.21.5",
|
"1.21.4",
|
||||||
"1.21.6",
|
"1.21.5",
|
||||||
"1.21.7",
|
"1.21.6",
|
||||||
"1.21.8",
|
"1.21.7",
|
||||||
"1.21.9",
|
"1.21.8",
|
||||||
"1.21.10",
|
"1.21.9",
|
||||||
"1.21.11",
|
"1.21.10",
|
||||||
"1.21.11"
|
"1.21.11"
|
||||||
],
|
],
|
||||||
"channel": "RELEASE",
|
"channel": "release",
|
||||||
"loaders": [
|
"loaders": [
|
||||||
"paper",
|
"paper",
|
||||||
"folia"
|
"folia"
|
||||||
],
|
],
|
||||||
"featured": true
|
"featured": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,29 +1,31 @@
|
|||||||
{
|
{
|
||||||
"project_name": "FancyHolograms",
|
"project_name": "FancyHolograms",
|
||||||
"project_id": "5QNgOj66",
|
"plugin_jar_path": "/plugins/fancyholograms/build/libs/FancyHolograms-%VERSION%.jar",
|
||||||
"plugin_jar_path": "../../../../plugins/fancyholograms/build/libs/FancyHolograms-%VERSION%.jar",
|
"changelog_path": "/plugins/fancyholograms/CHANGELOG-SNAPSHOT.md",
|
||||||
"changelog_path": "../../../../plugins/fancyholograms/CHANGELOG-SNAPSHOT.md",
|
"version_path": "/plugins/fancyholograms/VERSION",
|
||||||
"version_path": "../../../../plugins/fancyholograms/VERSION",
|
"modrinth": {
|
||||||
"supported_versions": [
|
"project_id": "5QNgOj66",
|
||||||
"1.20.5",
|
"supported_versions": [
|
||||||
"1.20.6",
|
"1.20.5",
|
||||||
"1.21",
|
"1.20.6",
|
||||||
"1.21.1",
|
"1.21",
|
||||||
"1.21.2",
|
"1.21.1",
|
||||||
"1.21.3",
|
"1.21.2",
|
||||||
"1.21.4",
|
"1.21.3",
|
||||||
"1.21.5",
|
"1.21.4",
|
||||||
"1.21.6",
|
"1.21.5",
|
||||||
"1.21.7",
|
"1.21.6",
|
||||||
"1.21.8",
|
"1.21.7",
|
||||||
"1.21.9",
|
"1.21.8",
|
||||||
"1.21.10",
|
"1.21.9",
|
||||||
"1.21.11-pre4"
|
"1.21.10",
|
||||||
],
|
"1.21.11-pre4"
|
||||||
"channel": "ALPHA",
|
],
|
||||||
"loaders": [
|
"channel": "alpha",
|
||||||
"paper",
|
"loaders": [
|
||||||
"folia"
|
"paper",
|
||||||
],
|
"folia"
|
||||||
"featured": false
|
],
|
||||||
|
"featured": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,34 +1,36 @@
|
|||||||
{
|
{
|
||||||
"project_name": "FancyNpcs",
|
"project_name": "FancyNpcs",
|
||||||
"project_id": "EeyAn23L",
|
"plugin_jar_path": "/plugins/fancynpcs/build/libs/FancyNpcs-%VERSION%.jar",
|
||||||
"plugin_jar_path": "../../../../plugins/fancynpcs/build/libs/FancyNpcs-%VERSION%.jar",
|
"changelog_path": "/plugins/fancynpcs/CHANGELOG.md",
|
||||||
"changelog_path": "../../../../plugins/fancynpcs/CHANGELOG.md",
|
"version_path": "/plugins/fancynpcs/VERSION",
|
||||||
"version_path": "../../../../plugins/fancynpcs/VERSION",
|
"modrinth": {
|
||||||
"supported_versions": [
|
"project_id": "EeyAn23L",
|
||||||
"1.20",
|
"supported_versions": [
|
||||||
"1.20.1",
|
"1.20",
|
||||||
"1.20.2",
|
"1.20.1",
|
||||||
"1.20.3",
|
"1.20.2",
|
||||||
"1.20.4",
|
"1.20.3",
|
||||||
"1.20.5",
|
"1.20.4",
|
||||||
"1.20.6",
|
"1.20.5",
|
||||||
"1.21",
|
"1.20.6",
|
||||||
"1.21.1",
|
"1.21",
|
||||||
"1.21.2",
|
"1.21.1",
|
||||||
"1.21.3",
|
"1.21.2",
|
||||||
"1.21.4",
|
"1.21.3",
|
||||||
"1.21.5",
|
"1.21.4",
|
||||||
"1.21.6",
|
"1.21.5",
|
||||||
"1.21.7",
|
"1.21.6",
|
||||||
"1.21.8",
|
"1.21.7",
|
||||||
"1.21.9",
|
"1.21.8",
|
||||||
"1.21.10",
|
"1.21.9",
|
||||||
"1.21.11"
|
"1.21.10",
|
||||||
],
|
"1.21.11"
|
||||||
"channel": "RELEASE",
|
],
|
||||||
"loaders": [
|
"channel": "release",
|
||||||
"paper",
|
"loaders": [
|
||||||
"folia"
|
"paper",
|
||||||
],
|
"folia"
|
||||||
"featured": true
|
],
|
||||||
|
"featured": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,34 +1,36 @@
|
|||||||
{
|
{
|
||||||
"project_name": "FancyNpcs",
|
"project_name": "FancyNpcs",
|
||||||
"project_id": "EeyAn23L",
|
"plugin_jar_path": "/plugins/fancynpcs/build/libs/FancyNpcs-%VERSION%.jar",
|
||||||
"plugin_jar_path": "../../../../plugins/fancynpcs/build/libs/FancyNpcs-%VERSION%.jar",
|
"changelog_path": "/plugins/fancynpcs/CHANGELOG-SNAPSHOT.md",
|
||||||
"changelog_path": "../../../../plugins/fancynpcs/CHANGELOG-SNAPSHOT.md",
|
"version_path": "/plugins/fancynpcs/VERSION",
|
||||||
"version_path": "../../../../plugins/fancynpcs/VERSION",
|
"modrinth": {
|
||||||
"supported_versions": [
|
"project_id": "EeyAn23L",
|
||||||
"1.20",
|
"supported_versions": [
|
||||||
"1.20.1",
|
"1.20",
|
||||||
"1.20.2",
|
"1.20.1",
|
||||||
"1.20.3",
|
"1.20.2",
|
||||||
"1.20.4",
|
"1.20.3",
|
||||||
"1.20.5",
|
"1.20.4",
|
||||||
"1.20.6",
|
"1.20.5",
|
||||||
"1.21",
|
"1.20.6",
|
||||||
"1.21.1",
|
"1.21",
|
||||||
"1.21.2",
|
"1.21.1",
|
||||||
"1.21.3",
|
"1.21.2",
|
||||||
"1.21.4",
|
"1.21.3",
|
||||||
"1.21.5",
|
"1.21.4",
|
||||||
"1.21.6",
|
"1.21.5",
|
||||||
"1.21.7",
|
"1.21.6",
|
||||||
"1.21.8",
|
"1.21.7",
|
||||||
"1.21.9",
|
"1.21.8",
|
||||||
"1.21.10",
|
"1.21.9",
|
||||||
"1.21.11-pre4"
|
"1.21.10",
|
||||||
],
|
"1.21.11-pre4"
|
||||||
"channel": "BETA",
|
],
|
||||||
"loaders": [
|
"channel": "beta",
|
||||||
"paper",
|
"loaders": [
|
||||||
"folia"
|
"paper",
|
||||||
],
|
"folia"
|
||||||
"featured": false
|
],
|
||||||
|
"featured": false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,6 @@ include(":libraries:packets:implementations:1_21_9")
|
|||||||
include(":libraries:packets:implementations:1_21_11")
|
include(":libraries:packets:implementations:1_21_11")
|
||||||
|
|
||||||
|
|
||||||
include(":tools:deployment")
|
|
||||||
include(":tools:quick-e2e")
|
include(":tools:quick-e2e")
|
||||||
|
|
||||||
pluginManagement {
|
pluginManagement {
|
||||||
|
|||||||
@@ -1,61 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id("java")
|
|
||||||
id("maven-publish")
|
|
||||||
id("com.gradleup.shadow")
|
|
||||||
}
|
|
||||||
|
|
||||||
group = "de.oliver"
|
|
||||||
description = "Tool to deploy Minecraft plugins"
|
|
||||||
|
|
||||||
java {
|
|
||||||
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
|
|
||||||
}
|
|
||||||
|
|
||||||
repositories {
|
|
||||||
mavenCentral()
|
|
||||||
maven("https://repo.papermc.io/repository/maven-public/")
|
|
||||||
maven("https://repo.fancyinnovations.com/releases")
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation("dev.masecla:Modrinth4J:2.2.0")
|
|
||||||
|
|
||||||
implementation("com.google.code.gson:gson:2.13.1")
|
|
||||||
implementation("com.squareup.okhttp3:okhttp:4.12.0")
|
|
||||||
implementation("org.jetbrains:annotations:26.0.2")
|
|
||||||
|
|
||||||
implementation("de.oliver.FancyAnalytics:java-sdk:0.0.5")
|
|
||||||
implementation("de.oliver.FancyAnalytics:logger:0.0.8")
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks {
|
|
||||||
jar {
|
|
||||||
manifest {
|
|
||||||
attributes["Main-Class"] = "de.oliver.deployment.Main"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
shadowJar {
|
|
||||||
archiveClassifier.set("")
|
|
||||||
}
|
|
||||||
|
|
||||||
compileJava {
|
|
||||||
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
|
|
||||||
|
|
||||||
// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable.
|
|
||||||
// See https://openjdk.java.net/jeps/247 for more information.
|
|
||||||
options.release.set(21)
|
|
||||||
}
|
|
||||||
|
|
||||||
java {
|
|
||||||
withSourcesJar()
|
|
||||||
withJavadocJar()
|
|
||||||
}
|
|
||||||
|
|
||||||
javadoc {
|
|
||||||
options.encoding = Charsets.UTF_8.name() // We want UTF-8 for everything
|
|
||||||
}
|
|
||||||
processResources {
|
|
||||||
filteringCharset = Charsets.UTF_8.name() // We want UTF-8 for everything
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
{
|
|
||||||
"project_name": "FancyHolograms",
|
|
||||||
"project_id": "fancyholograms",
|
|
||||||
"plugin_jar_path": "../../../plugins/fancyholograms/build/libs/FancyHolograms-*.jar",
|
|
||||||
"changelog_path": "../../../plugins/fancyholograms/CHANGELOG.md",
|
|
||||||
"version": "3.0.0",
|
|
||||||
"supported_versions":[
|
|
||||||
"1.19.4",
|
|
||||||
"1.20",
|
|
||||||
"1.20.1",
|
|
||||||
"1.20.2",
|
|
||||||
"1.20.3",
|
|
||||||
"1.20.4",
|
|
||||||
"1.20.5",
|
|
||||||
"1.20.6",
|
|
||||||
"1.21",
|
|
||||||
"1.21.1",
|
|
||||||
"1.21.2",
|
|
||||||
"1.21.3",
|
|
||||||
"1.21.4"
|
|
||||||
],
|
|
||||||
"channel": "release",
|
|
||||||
"loaders": [
|
|
||||||
"paper",
|
|
||||||
"folia"
|
|
||||||
],
|
|
||||||
"featured": true
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
package de.oliver.deployment;
|
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
|
|
||||||
public record Configuration(
|
|
||||||
@SerializedName("project_name") String projectName,
|
|
||||||
@SerializedName("project_id") String projectID,
|
|
||||||
@SerializedName("plugin_jar_path") String pluginJarPath,
|
|
||||||
@SerializedName("changelog_path") String changeLogPath,
|
|
||||||
@SerializedName("version_path") String versionPath,
|
|
||||||
@SerializedName("supported_versions") String[] supportedVersions,
|
|
||||||
String channel,
|
|
||||||
@SerializedName("loaders") String[] loaders,
|
|
||||||
boolean featured
|
|
||||||
) {
|
|
||||||
|
|
||||||
public String readVersion() {
|
|
||||||
try {
|
|
||||||
return Files.readString(Path.of(versionPath));
|
|
||||||
} catch (IOException e) {
|
|
||||||
return "unknown";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
package de.oliver.deployment;
|
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
|
||||||
import de.oliver.deployment.git.GitService;
|
|
||||||
import de.oliver.deployment.modrinth.ModrinthService;
|
|
||||||
import de.oliver.deployment.notification.DiscordWebhook;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class Main {
|
|
||||||
|
|
||||||
private static final Gson GSON = new Gson();
|
|
||||||
|
|
||||||
public static void main(String[] args) throws IOException {
|
|
||||||
if (args.length < 2) {
|
|
||||||
System.err.println("Usage: java -jar deployment.jar <platform> <config_file path> [send_notification]");
|
|
||||||
System.exit(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
String platform = args[0];
|
|
||||||
|
|
||||||
String configFilePath = args[1];
|
|
||||||
String configData = Files.readString(Path.of(configFilePath));
|
|
||||||
Configuration configuration = GSON.fromJson(configData, Configuration.class);
|
|
||||||
|
|
||||||
boolean sendNotification = args.length > 2 && Boolean.parseBoolean(args[2]);
|
|
||||||
|
|
||||||
if (platform.equalsIgnoreCase("modrinth")) {
|
|
||||||
deployToModrinth(configuration);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sendNotification) {
|
|
||||||
sendDiscordNotification(configuration);
|
|
||||||
System.out.println("Deployment completed and notification sent.");
|
|
||||||
} else {
|
|
||||||
System.out.println("Deployment completed without sending notification.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void deployToModrinth(Configuration configuration) {
|
|
||||||
String modrinthApiKey = System.getenv("MODRINTH_API_KEY");
|
|
||||||
ModrinthService modrinthService = new ModrinthService(modrinthApiKey);
|
|
||||||
try {
|
|
||||||
modrinthService.deployPlugin(configuration);
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void sendDiscordNotification(Configuration configuration) {
|
|
||||||
String discordWebhookUrl = System.getenv("DISCORD_WEBHOOK_URL");
|
|
||||||
if (discordWebhookUrl != null) {
|
|
||||||
DiscordWebhook.Data data = new DiscordWebhook.Data("Deployment completed", List.of(
|
|
||||||
new DiscordWebhook.Data.Embed(
|
|
||||||
"New version of " + configuration.projectName(),
|
|
||||||
"""
|
|
||||||
**Version:** %s
|
|
||||||
**Channel:** %s
|
|
||||||
**Commit:** [%s](https://github.com/FancyMcPlugins/fancyplugins/commit/%s)
|
|
||||||
**Download:** %s
|
|
||||||
""".formatted(
|
|
||||||
configuration.readVersion(),
|
|
||||||
configuration.channel(),
|
|
||||||
GitService.getCommitHash().substring(0, 7),
|
|
||||||
GitService.getCommitHash(),
|
|
||||||
"https://modrinth.com/plugin/" + configuration.projectName() + "/version/" + configuration.readVersion()),
|
|
||||||
|
|
||||||
0x00FF00
|
|
||||||
)
|
|
||||||
));
|
|
||||||
DiscordWebhook discordWebhook = new DiscordWebhook();
|
|
||||||
discordWebhook.sendWebhook(discordWebhookUrl, data);
|
|
||||||
} else {
|
|
||||||
System.out.println("Discord webhook URL not set. Skipping notification.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package de.oliver.deployment.git;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
public class GitService {
|
|
||||||
|
|
||||||
public static String getCommitHash() {
|
|
||||||
ProcessBuilder processBuilder = new ProcessBuilder("git", "rev-parse", "HEAD");
|
|
||||||
processBuilder.redirectErrorStream(true);
|
|
||||||
processBuilder.directory(new java.io.File("."));
|
|
||||||
|
|
||||||
try {
|
|
||||||
Process process = processBuilder.start();
|
|
||||||
return new String(process.getInputStream().readAllBytes()).trim();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return "unknown";
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getCommitMessage() {
|
|
||||||
ProcessBuilder processBuilder = new ProcessBuilder("git", "log", "-1", "--pretty=%B");
|
|
||||||
processBuilder.redirectErrorStream(true);
|
|
||||||
processBuilder.directory(new java.io.File("."));
|
|
||||||
|
|
||||||
try {
|
|
||||||
Process process = processBuilder.start();
|
|
||||||
return new String(process.getInputStream().readAllBytes()).trim();
|
|
||||||
} catch (IOException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
return "unknown";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
package de.oliver.deployment.modrinth;
|
|
||||||
|
|
||||||
import de.oliver.deployment.Configuration;
|
|
||||||
import de.oliver.deployment.git.GitService;
|
|
||||||
import masecla.modrinth4j.client.agent.UserAgent;
|
|
||||||
import masecla.modrinth4j.endpoints.version.CreateVersion;
|
|
||||||
import masecla.modrinth4j.main.ModrinthAPI;
|
|
||||||
import masecla.modrinth4j.model.version.ProjectVersion;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.nio.file.Files;
|
|
||||||
import java.nio.file.Path;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
|
||||||
|
|
||||||
public class ModrinthService {
|
|
||||||
|
|
||||||
private final ModrinthAPI api;
|
|
||||||
|
|
||||||
public ModrinthService(String apiKey) {
|
|
||||||
this.api = ModrinthAPI.rateLimited(
|
|
||||||
UserAgent.builder()
|
|
||||||
.authorUsername("Oliver")
|
|
||||||
.contact("oliver@fancyinnovations.com")
|
|
||||||
.build(),
|
|
||||||
apiKey
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void deployPlugin(Configuration config) throws IOException {
|
|
||||||
String changelog = Files.readString(Path.of(config.changeLogPath()));
|
|
||||||
changelog = changelog.replaceAll("%COMMIT_HASH%", GitService.getCommitHash());
|
|
||||||
changelog = changelog.replaceAll("%COMMIT_MESSAGE%", GitService.getCommitMessage());
|
|
||||||
|
|
||||||
String version = config.readVersion();
|
|
||||||
|
|
||||||
String pluginJarPath = config.pluginJarPath().replace("%VERSION%", version);
|
|
||||||
File pluginFile = new File(pluginJarPath);
|
|
||||||
|
|
||||||
InputStream pluginJarFileStream = Files.newInputStream(pluginFile.toPath());
|
|
||||||
|
|
||||||
CreateVersion.CreateVersionRequest request = new CreateVersion.CreateVersionRequest(
|
|
||||||
version,
|
|
||||||
version,
|
|
||||||
changelog,
|
|
||||||
new ArrayList<>(),
|
|
||||||
Arrays.asList(config.supportedVersions()),
|
|
||||||
ProjectVersion.VersionType.valueOf(config.channel()),
|
|
||||||
Arrays.asList(config.loaders()),
|
|
||||||
config.featured(),
|
|
||||||
config.projectID(),
|
|
||||||
pluginJarPath,
|
|
||||||
List.of(pluginFile.getName()),
|
|
||||||
List.of(pluginJarFileStream)
|
|
||||||
);
|
|
||||||
|
|
||||||
System.out.println("Creating version: " + request);
|
|
||||||
|
|
||||||
CompletableFuture<ProjectVersion> resp = api.versions().createProjectVersion(request);
|
|
||||||
ProjectVersion createdVersion = resp.join();
|
|
||||||
|
|
||||||
System.out.println("Version created: " + createdVersion);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
package de.oliver.deployment.notification;
|
|
||||||
|
|
||||||
import de.oliver.fancyanalytics.sdk.utils.HttpRequest;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URISyntaxException;
|
|
||||||
import java.net.http.HttpResponse;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class DiscordWebhook {
|
|
||||||
|
|
||||||
public void sendWebhook(String webhookUrl, Data data) {
|
|
||||||
HttpRequest request = new HttpRequest(webhookUrl)
|
|
||||||
.withMethod("POST")
|
|
||||||
.withHeader("Content-Type", "application/json")
|
|
||||||
.withBody(data);
|
|
||||||
|
|
||||||
try {
|
|
||||||
HttpResponse<String> resp = request.send();
|
|
||||||
if (resp.statusCode() != 204) {
|
|
||||||
System.out.println("Failed to send message with discord webhook: " + resp.body());
|
|
||||||
}
|
|
||||||
} catch (URISyntaxException | IOException | InterruptedException e) {
|
|
||||||
System.out.println("Failed to send webhook");
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public record Data(String content, List<Embed> embeds) {
|
|
||||||
|
|
||||||
public record Embed(String title, String description, int color) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user