diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4258054..8b382dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,73 +1,66 @@ -name: Release +name: Build and Release Native Binaries on: push: tags: - 'v*' - workflow_dispatch: - inputs: - version: - description: 'Version to release (e.g., 1.0.0)' - required: true - type: string jobs: build: - name: Build ${{ matrix.platform }} strategy: - fail-fast: false matrix: include: - os: ubuntu-latest platform: linux-x64 - - os: macos-15-intel - platform: macos-x64 - os: macos-latest platform: macos-arm64 - + runs-on: ${{ matrix.os }} - + steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup GraalVM - uses: graalvm/setup-graalvm@v1 - with: - java-version: '21' - distribution: 'graalvm' - github-token: ${{ secrets.GITHUB_TOKEN }} - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - - - name: Install native build tools (Linux) - if: runner.os == 'Linux' - run: | - sudo apt-get update - sudo apt-get install -y build-essential zlib1g-dev - - - name: Build native binary - run: gradle clean nativeCompile --info - - - name: Package binary - run: | - mkdir -p dist - cp build/native/nativeCompile/notevc dist/ - cd dist - tar -czf notevc-${{ matrix.platform }}.tar.gz notevc - - if [[ "${{ runner.os }}" == "Linux" ]]; then - sha256sum notevc-${{ matrix.platform }}.tar.gz > notevc-${{ matrix.platform }}.tar.gz.sha256 - else - shasum -a 256 notevc-${{ matrix.platform }}.tar.gz > notevc-${{ matrix.platform }}.tar.gz.sha256 - fi - - - name: Upload build artifacts - uses: actions/upload-artifact@v4 - with: - name: notevc-${{ matrix.platform }} - path: | - dist/notevc-${{ matrix.platform }}.tar.gz - dist/notevc-${{ matrix.platform }}.tar.gz.sha256 - + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup GraalVM + uses: graalvm/setup-graalvm@v1 + with: + java-version: '24' + distribution: 'graalvm' + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Build native binary + run: ./gradlew nativeCompile + + - name: Rename binary for platform + run: | + mv build/native/nativeCompile/notevc notevc-${{ matrix.platform }} + + - name: Upload binary as artifact + uses: actions/upload-artifact@v4 + with: + name: notevc-${{ matrix.platform }} + path: notevc-${{ matrix.platform }} + + release: + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: binaries + + - name: Create Release + uses: softprops/action-gh-release@v1 + with: + files: binaries/*/* + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.gradle.kts b/build.gradle.kts index 38aa6f4..75fec8d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,11 +6,11 @@ plugins { application id("com.github.gmazzo.buildconfig") version "4.1.2" id("com.gradleup.shadow") version "9.2.2" - id("org.graalvm.buildtools.native") version "0.9.28" + id("org.graalvm.buildtools.native") version "0.10.3" } group = "io.notevc" -version = "1.0.0" +version = "1.0.1" buildConfig { buildConfigField("String", "VERSION", "\"${project.version}\"") @@ -35,10 +35,8 @@ application { mainClass.set("io.notevc.NoteVCKt") } - - tasks.shadowJar { - archiveClassifier.set("") // This should remove the -all suffix + archiveClassifier.set("") manifest { attributes(mapOf("Main-Class" to "io.notevc.NoteVCKt")) } @@ -50,9 +48,6 @@ graalvmNative { imageName.set("notevc") mainClass.set("io.notevc.NoteVCKt") - // Force it to use the shadowJar - classpath.from(tasks.shadowJar.get().outputs.files) - buildArgs.addAll(listOf( "--no-fallback", "-H:+ReportExceptionStackTraces", @@ -74,9 +69,10 @@ tasks.withType { useJUnitPlatform() } -tasks.nativeCompile { - dependsOn(tasks.shadowJar) -} +// Remove this line - let GraalVM use the default classpath +// tasks.nativeCompile { +// dependsOn(tasks.shadowJar) +// } tasks.build { dependsOn(tasks.shadowJar) diff --git a/gradle.properties b/gradle.properties index 6f78d3f..e0aa344 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,2 @@ org.gradle.caching=true -org.gradle.configuration-cache=true +org.gradle.configuration-cache=false diff --git a/src/main/kotlin/io/notevc/commands/StatusCommand.kt b/src/main/kotlin/io/notevc/commands/StatusCommand.kt index 0dc8467..a9d375c 100644 --- a/src/main/kotlin/io/notevc/commands/StatusCommand.kt +++ b/src/main/kotlin/io/notevc/commands/StatusCommand.kt @@ -128,7 +128,7 @@ class StatusCommand { grouped[FileStatusType.UNTRACKED]?.let { untrackedFiles -> output.appendLine(ColorUtils.bold("Untracked files:")) untrackedFiles.forEach { fileStatus -> - output.appendLine(" ${ColorUtils.untracked(fileStatus.path)} ${ColorUtils.dim("${fileStatus.blockCount} blocks)")}") + output.appendLine(" ${ColorUtils.untracked(fileStatus.path)} ${ColorUtils.dim("(${fileStatus.blockCount} blocks)")}") } output.appendLine() }