Skip to content

Commit ff69fb2

Browse files
Add deployment
1 parent 69714fd commit ff69fb2

File tree

10 files changed

+236
-14
lines changed

10 files changed

+236
-14
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Build and test
2+
3+
on:
4+
push:
5+
pull_request:
6+
types:
7+
- opened
8+
jobs:
9+
build-plugins:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
16+
- name: Cache Gradle dependencies
17+
uses: actions/cache@v4
18+
with:
19+
path: ~/.gradle
20+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
21+
restore-keys: |
22+
${{ runner.os }}-gradle-
23+
24+
- name: Setup Java
25+
uses: actions/setup-java@v2
26+
with:
27+
distribution: 'adopt'
28+
java-version: '21'
29+
30+
- name: Modify gradlew permissions
31+
run: chmod +x ./gradlew
32+
33+
- name: Build FancyEconomy
34+
run: ./gradlew :shadowJar
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Deploy FancyEconomy (release)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v4
13+
14+
- name: Cache Gradle dependencies
15+
uses: actions/cache@v4
16+
with:
17+
path: ~/.gradle
18+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
19+
restore-keys: |
20+
${{ runner.os }}-gradle-
21+
22+
- name: Setup Java
23+
uses: actions/setup-java@v2
24+
with:
25+
distribution: 'adopt'
26+
java-version: '21'
27+
28+
- name: Modify gradlew permissions
29+
run: chmod +x ./gradlew
30+
31+
- name: Build
32+
env:
33+
RELEASE_CHANNEL: 'release'
34+
run: ./gradlew :shadowJar
35+
36+
- name: Get last commit SHA and message
37+
id: last_commit
38+
run: |
39+
{
40+
echo "commit_sha=$(git rev-parse --short HEAD)"
41+
echo "commit_msg<<EOF"
42+
git log -1 --pretty=%B
43+
echo "EOF"
44+
} >> "$GITHUB_OUTPUT"
45+
46+
- name: Deploy
47+
uses: fancyinnovations/fancyverteiler@main
48+
with:
49+
config_path: "/plugins/fancydialogs/release_deployment_config.json"
50+
github_repo_url: "https://github.com/FancyInnovations/FancyPlugins"
51+
commit_sha: ${{ steps.last_commit.outputs.commit_sha }}
52+
commit_message: ${{ steps.last_commit.outputs.commit_msg }}
53+
fancyspaces_api_key: ${{ secrets.FANCYSPACES_API_KEY }}
54+
modrinth_api_key: ${{ secrets.MODRINTH_API_KEY }}
55+
hangar_api_key: ${{ secrets.HANGAR_API_KEY }}
56+
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy FancyEconomy (snapshot)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
deploy:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v4
13+
14+
- name: Cache Gradle dependencies
15+
uses: actions/cache@v4
16+
with:
17+
path: ~/.gradle
18+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
19+
restore-keys: |
20+
${{ runner.os }}-gradle-
21+
22+
- name: Setup Java
23+
uses: actions/setup-java@v2
24+
with:
25+
distribution: 'adopt'
26+
java-version: '21'
27+
28+
- name: Modify gradlew permissions
29+
run: chmod +x ./gradlew
30+
31+
- name: Build
32+
env:
33+
RELEASE_CHANNEL: 'snapshot'
34+
run: ./gradlew :shadowJar
35+
36+
- name: Get last commit SHA and message
37+
id: last_commit
38+
run: |
39+
{
40+
echo "commit_sha=$(git rev-parse --short HEAD)"
41+
echo "commit_msg<<EOF"
42+
git log -1 --pretty=%B
43+
echo "EOF"
44+
} >> "$GITHUB_OUTPUT"
45+
46+
- name: Deploy
47+
uses: fancyinnovations/fancyverteiler@main
48+
with:
49+
config_path: "/snapshot_deployment_config.json"
50+
github_repo_url: "https://github.com/FancyInnovations/FancyPlugins"
51+
commit_sha: ${{ steps.last_commit.outputs.commit_sha }}
52+
commit_message: ${{ steps.last_commit.outputs.commit_msg }}
53+
fancyspaces_api_key: ${{ secrets.FANCYSPACES_API_KEY }}
54+
discord_webhook_url: ${{ secrets.DISCORD_WEBHOOK_URL }}

.idea/misc.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG-SNAPSHOT.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Commit hash: %COMMIT_HASH%
2+
3+
Commit message: %COMMIT_MESSAGE%
4+
5+
*(The last commit message does not always directly reflect the changes related to this version.)*
6+
7+
Keep in mind that this is a snapshot version. Snapshot versions are **not** meant to be used in production. They are for **testing purposes only** and may contain bugs or incomplete features. Use at your own risk.

CHANGELOG.md

Whitespace-only changes.

build.gradle.kts

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ paper {
5656
loader = "de.oliver.fancyeconomy.FancyEconomyLoader"
5757
foliaSupported = true
5858
version = getFEVersion()
59-
description = "Simple and lightweight economy plugin with support for multiple currencies and a powerful API"
59+
description = "Simple and lightweight economy plugin with support for multiple currencies"
6060
apiVersion = "1.19"
6161
load = BukkitPluginDescription.PluginLoadOrder.POSTWORLD
6262
serverDependencies {
@@ -89,29 +89,51 @@ tasks {
8989
publishing {
9090
repositories {
9191
maven {
92-
name = "fancypluginsReleases"
93-
url = uri("https://repo.fancyinnovations.com/releases")
94-
credentials(PasswordCredentials::class)
92+
name = "fancyspacesReleases"
93+
url = uri("https://maven.fancyspaces.net/fancyinnovations/releases")
94+
95+
credentials(HttpHeaderCredentials::class) {
96+
name = "Authorization"
97+
value = "ApiKey " + providers
98+
.gradleProperty("fancyspacesApiKey")
99+
.orElse(
100+
providers
101+
.environmentVariable("FANCYSPACES_API_KEY")
102+
.orElse("")
103+
)
104+
.get()
105+
}
106+
95107
authentication {
96-
isAllowInsecureProtocol = true
97-
create<BasicAuthentication>("basic")
108+
create<HttpHeaderAuthentication>("header")
98109
}
99110
}
100111

101112
maven {
102-
name = "fancypluginsSnapshots"
103-
url = uri("https://repo.fancyinnovations.com/snapshots")
104-
credentials(PasswordCredentials::class)
113+
name = "fancyspacesSnapshots"
114+
url = uri("https://maven.fancyspaces.net/fancyinnovations/snapshots")
115+
116+
credentials(HttpHeaderCredentials::class) {
117+
name = "Authorization"
118+
value = "ApiKey " + providers
119+
.gradleProperty("fancyspacesApiKey")
120+
.orElse(
121+
providers
122+
.environmentVariable("FANCYSPACES_API_KEY")
123+
.orElse("")
124+
)
125+
.get()
126+
}
127+
105128
authentication {
106-
isAllowInsecureProtocol = true
107-
create<BasicAuthentication>("basic")
129+
create<HttpHeaderAuthentication>("header")
108130
}
109131
}
110132
}
111133
publications {
112134
create<MavenPublication>("maven") {
113-
groupId = project.group.toString()
114-
artifactId = project.name
135+
groupId = "de.oliver"
136+
artifactId = "fancyeconomy"
115137
version = getFEVersion()
116138
from(project.components["java"])
117139
}

gradlew

100644100755
File mode changed.

release_deployment_config.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"project_name": "FancyEconomy",
3+
"plugin_jar_path": "build/libs/FancyEconomy-%VERSION%.jar",
4+
"changelog_path": "CHANGELOG.md",
5+
"version_path": "VERSION",
6+
"fancyspaces": {
7+
"space_id": "MX6Cna3z",
8+
"platform": "paper",
9+
"channel": "release",
10+
"supported_versions": [
11+
"1.21.11"
12+
]
13+
},
14+
"modrinth": {
15+
"project_id": "HwkayEYZ",
16+
"supported_versions": [
17+
"1.21.11"
18+
],
19+
"channel": "release",
20+
"loaders": [
21+
"paper",
22+
"folia"
23+
],
24+
"featured": true
25+
},
26+
"hangar": {
27+
"author": "oliver",
28+
"project_id": "fancyeconomy",
29+
"supported_versions": [
30+
"1.21.11"
31+
],
32+
"channel": "Release"
33+
}
34+
}

snapshot_deployment_config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"project_name": "FancyEconomy",
3+
"plugin_jar_path": "build/libs/FancyEconomy-%VERSION%.jar",
4+
"changelog_path": "CHANGELOG-SNAPSHOT.md",
5+
"version_path": "VERSION",
6+
"fancyspaces": {
7+
"space_id": "MX6Cna3z",
8+
"platform": "paper",
9+
"channel": "beta",
10+
"supported_versions": [
11+
"1.21.11"
12+
]
13+
}
14+
}

0 commit comments

Comments
 (0)