Skip to content

Commit 02e9135

Browse files
committed
more publishing probably-fixes
1 parent 123ee50 commit 02e9135

2 files changed

Lines changed: 31 additions & 12 deletions

File tree

.github/workflows/publish.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,7 @@
44
name: Publish Release
55

66
on:
7-
push:
8-
tags:
9-
- 'v*'
107
workflow_dispatch:
11-
inputs:
12-
version:
13-
description: 'Version to publish (without v prefix)'
14-
required: true
15-
type: string
168

179
env:
1810
JAVA_VERSION: 21
@@ -32,6 +24,33 @@ jobs:
3224
- name: ✨ Checkout repository
3325
uses: actions/checkout@v4
3426

27+
- name: 📖 Extract version from gradle.properties
28+
id: version
29+
run: |
30+
VERSION=$(grep '^mod_version' gradle.properties | cut -d'=' -f2 | tr -d ' ')
31+
TAG="v$VERSION"
32+
echo "version=$VERSION" >> $GITHUB_OUTPUT
33+
echo "tag=$TAG" >> $GITHUB_OUTPUT
34+
echo "Extracted version: $VERSION"
35+
echo "Tag will be: $TAG"
36+
37+
- name: ❌ Check if tag already exists
38+
run: |
39+
if git ls-remote --tags origin | grep -q "refs/tags/${{ steps.version.outputs.tag }}$"; then
40+
echo "❌ Tag ${{ steps.version.outputs.tag }} already exists!"
41+
echo "Please update the mod_version in gradle.properties to create a new release."
42+
exit 1
43+
fi
44+
echo "✅ Tag ${{ steps.version.outputs.tag }} does not exist, proceeding..."
45+
46+
- name: 🏷️ Create and push tag
47+
run: |
48+
git config user.name "github-actions[bot]"
49+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
50+
git tag ${{ steps.version.outputs.tag }}
51+
git push origin ${{ steps.version.outputs.tag }}
52+
echo "✅ Created and pushed tag: ${{ steps.version.outputs.tag }}"
53+
3554
- name: 🛂 Validate Gradle wrapper
3655
uses: gradle/actions/wrapper-validation@v4
3756

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ modrinth {
210210
loaders = ['fabric']
211211

212212
dependencies = [
213-
project.mr_relations_required?.split(',')?.collect { required.project it },
214-
project.mr_relations_optional?.split(',')?.collect { optional.project it },
215-
project.mr_relations_embedded?.split(',')?.collect { embedded.project it },
216-
project.mr_relations_incompatible?.split(',')?.collect { incompatible.project it },
213+
project.mr_relations_required?.split(',')?.findAll { it?.trim() }?.collect { required.project it },
214+
project.mr_relations_optional?.split(',')?.findAll { it?.trim() }?.collect { optional.project it },
215+
project.mr_relations_embedded?.split(',')?.findAll { it?.trim() }?.collect { embedded.project it },
216+
project.mr_relations_incompatible?.split(',')?.findAll { it?.trim() }?.collect { incompatible.project it },
217217
].findAll { it }.flatten()
218218
}
219219

0 commit comments

Comments
 (0)