Skip to content

Commit 3a97dc7

Browse files
committed
- Update Github Actions Workflows (#12)
- Downgrade build Java version to 17 (min. for Velocity, max. compatibility)
1 parent 8bbdc32 commit 3a97dc7

File tree

8 files changed

+193
-3
lines changed

8 files changed

+193
-3
lines changed
File renamed without changes.

.github/workflows/devbuild.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Publish Dev Build
2+
3+
on:
4+
push:
5+
branches:
6+
- "**" # Any branch
7+
tags-ignore:
8+
- "v*" # Skip real releases
9+
10+
jobs:
11+
build-dev:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up JDK
21+
uses: actions/setup-java@v4
22+
with:
23+
distribution: "temurin"
24+
java-version: "17"
25+
cache: gradle
26+
27+
- name: Get latest version tag v*
28+
id: tag
29+
run: |
30+
LAST_TAG=$(git describe --tags --match "v*" --abbrev=0)
31+
echo "tag=$LAST_TAG" >> $GITHUB_OUTPUT
32+
VERSION="${LAST_TAG#v}"
33+
echo "base_version=$VERSION" >> $GITHUB_OUTPUT
34+
35+
- name: Get short commit hash
36+
id: commit
37+
run: |
38+
HASH=$(git rev-parse --short HEAD)
39+
echo "hash=$HASH" >> $GITHUB_OUTPUT
40+
41+
- name: Compute dev version
42+
id: version
43+
run: |
44+
DEV_VERSION="${{ steps.tag.outputs.base_version }}+${{ steps.commit.outputs.hash }}-dev"
45+
echo "dev_version=$DEV_VERSION" >> $GITHUB_OUTPUT
46+
47+
- name: Setup Gradle
48+
uses: gradle/actions/setup-gradle@v3
49+
50+
- name: Grant execute permission for Gradle wrapper
51+
run: chmod +x ./gradlew
52+
53+
- name: Build with Gradle
54+
run: ./gradlew build -PpluginVersion=${{ steps.version.outputs.dev_version }}
55+
56+
- name: Get commit message
57+
id: message
58+
run: |
59+
MSG=$(git log -1 --pretty=%B)
60+
echo "message<<EOF" >> $GITHUB_OUTPUT
61+
echo "$MSG" >> $GITHUB_OUTPUT
62+
echo "EOF" >> $GITHUB_OUTPUT
63+
64+
- name: Modrinth Publish (Dev)
65+
uses: cloudnode-pro/modrinth-publish@v2.1.4
66+
with:
67+
token: ${{ secrets.MODRINTH_TOKEN }}
68+
project: ZIxTT2xI
69+
name: "vMessage ${{ steps.version.outputs.dev_version }}"
70+
version: ${{ steps.version.outputs.dev_version }}
71+
channel: alpha
72+
changelog: |
73+
${{ steps.message.outputs.message }}
74+
75+
_Be careful: This version is not production-ready!_
76+
_Automated development build from commit ${{ steps.commit.outputs.hash }}._
77+
loaders: velocity
78+
game-versions: '["1.21.x","1.20.x","1.19.x","1.18.x","1.17.x","1.16.x","1.15.x","1.14.x","1.13.x","1.12.x","1.11.x","1.10.x","1.9.x","1.8.x","1.7.x"]'
79+
files: build/libs/vMessage-${{ steps.version.outputs.dev_version }}.jar
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Update Modrinth Description
2+
3+
on:
4+
push:
5+
paths:
6+
- "README.md"
7+
branches:
8+
- master
9+
10+
jobs:
11+
update-description:
12+
name: Update Modrinth Project Description
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Update Modrinth description
20+
uses: funnyboy-roks/modrinth-auto-desc@v1.7
21+
with:
22+
auth-token: ${{ secrets.MODRINTH_TOKEN }}
23+
slug: ZIxTT2xI

.github/workflows/release.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
build-release:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Set up JDK
19+
uses: actions/setup-java@v4
20+
with:
21+
distribution: "temurin"
22+
java-version: "17"
23+
cache: gradle
24+
25+
- name: Extract version from tag
26+
id: vars
27+
run: |
28+
TAG="${GITHUB_REF#refs/tags/}"
29+
VERSION="${TAG#v}"
30+
echo "tag=$TAG" >> $GITHUB_OUTPUT
31+
echo "version=$VERSION" >> $GITHUB_OUTPUT
32+
33+
- name: Setup Gradle
34+
uses: gradle/actions/setup-gradle@v3
35+
with:
36+
build-scan-publish: true
37+
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
38+
build-scan-terms-of-use-agree: "yes"
39+
40+
- name: Grant execute permission for Gradle wrapper
41+
run: chmod +x ./gradlew
42+
43+
- name: Build with Gradle
44+
run: |
45+
./gradlew build -PpluginVersion=${{ steps.vars.outputs.version }}
46+
47+
- name: Generate changelog link
48+
id: changelog
49+
run: |
50+
LAST_TAG=$(git describe --tags --abbrev=0 HEAD^)
51+
echo "url=https://github.com/${GITHUB_REPOSITORY}/compare/${LAST_TAG}...${{ steps.vars.outputs.tag }}" >> $GITHUB_OUTPUT
52+
53+
- name: Get sanitized commit title
54+
id: commit_title
55+
run: |
56+
TITLE=$(echo "${GITHUB_EVENT_HEAD_COMMIT_MESSAGE:-$(git log -1 --pretty=%B)}" | head -n1 | sed -E 's/^#+[ ]*//')
57+
echo "title=$TITLE" >> $GITHUB_OUTPUT
58+
59+
- name: Create GitHub Release
60+
uses: softprops/action-gh-release@v2
61+
with:
62+
tag_name: ${{ steps.vars.outputs.tag }}
63+
name: ${{ steps.commit_title.outputs.title }}
64+
body: |
65+
${{ github.event.head_commit.message }}
66+
67+
**Full Changelog:** ${{ steps.changelog.outputs.url }}
68+
files: |
69+
build/libs/*.jar
70+
env:
71+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72+
73+
- name: Modrinth Publish
74+
uses: cloudnode-pro/modrinth-publish@v2.1.4
75+
with:
76+
token: ${{ secrets.MODRINTH_TOKEN }}
77+
project: ZIxTT2xI
78+
name: ${{ steps.commit_title.outputs.title }}
79+
version: ${{ steps.vars.outputs.version }}
80+
channel: release
81+
changelog: |
82+
${{ github.event.head_commit.message }}
83+
84+
**Full Changelog:** ${{ steps.changelog.outputs.url }}
85+
loaders: velocity
86+
game-versions: '["1.21.x","1.20.x","1.19.x","1.18.x","1.17.x","1.16.x","1.15.x","1.14.x","1.13.x","1.12.x","1.11.x","1.10.x","1.9.x","1.8.x","1.7.x"]'
87+
files: build/libs/vMessage-${{ steps.vars.outputs.version }}.jar

.idea/compiler.xml

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

.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.

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ version = pluginVersion
2222

2323
java {
2424
toolchain {
25-
languageVersion.set(JavaLanguageVersion.of(21))
25+
languageVersion.set(JavaLanguageVersion.of(17))
2626
}
2727
}
2828

0 commit comments

Comments
 (0)