File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44name : Publish Release
55
66on :
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
179env :
1810 JAVA_VERSION : 21
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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments