diff --git a/.github/workflows/publish-ide-plugin.yml b/.github/workflows/publish-ide-plugin.yml index c5c43de..03a5871 100644 --- a/.github/workflows/publish-ide-plugin.yml +++ b/.github/workflows/publish-ide-plugin.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: jobs: - publish-gradle-plugin: + publish-ide-plugin: runs-on: ubuntu-latest steps: - name: Checkout project sources @@ -19,12 +19,12 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 + - name: Build plugin + run: ./gradlew buildKelpIdePlugin readVersion + - name: Fetch plugin version id: print_version - run: ./gradlew printVersion - - - name: Build plugin - run: ./gradlew buildKelpIdePlugin + run: echo "version=$(cat build/VERSION)" >> $GITHUB_OUTPUT - name: Release plugin uses: ncipollo/release-action@v1 diff --git a/build.gradle.kts b/build.gradle.kts index b880951..31ba1c6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -154,9 +154,10 @@ tasks.register("buildKelpIdePlugin") { into(toGitHubReleaseDir) } -tasks.register("printVersion") { +tasks.register("readVersion") { inputs.property("version", project.version) + outputs.file(layout.buildDirectory.file("VERSION")) doLast { - exec { commandLine("echo \"plugin-version=${inputs.properties.values.first()}\" >> \$GITHUB_OUTPUT") } + outputs.files.first().writeText(inputs.properties.values.first().toString()) } }