Skip to content

Commit 0d8e047

Browse files
Update build.gradle version retrieval and enhance release workflow
- Changed version retrieval in build.gradle to use providers.gradleProperty for better compatibility. - Updated GitHub Actions workflow to set the version from tags and create a gradle.properties file for version management.
1 parent f8e4110 commit 0d8e047

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ jobs:
2222
id: get_version
2323
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
2424

25-
- name: Update build.gradle version from tag
25+
- name: Set version from tag
26+
env:
27+
VERSION: ${{ steps.get_version.outputs.VERSION }}
2628
run: |
27-
VERSION=${{ steps.get_version.outputs.VERSION }}
28-
sed -i "s/^version = '[0-9]\+\.[0-9]\+\.[0-9]\+'$/version = '${VERSION}'/" build.gradle
29+
echo "version=$VERSION" > gradle.properties
30+
echo "gradle.properties criado:"
31+
cat gradle.properties
2932
3033
- name: Set up JDK 21
3134
uses: actions/setup-java@v4

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
}
66

77
group = 'com.felipestanzani'
8-
version = findProperty('version') ?: '0.1.1'
8+
version = providers.gradleProperty('version').getOrElse('0.1.1')
99
description = 'Token-Oriented Object Notation (TOON) - A compact, human-readable format for LLM contexts'
1010

1111
// Apply external Gradle scripts

0 commit comments

Comments
 (0)