diff --git a/.github/workflows/build-gradle.yml b/.github/workflows/build-gradle.yml index 55e5d9230..254433edd 100644 --- a/.github/workflows/build-gradle.yml +++ b/.github/workflows/build-gradle.yml @@ -1,4 +1,4 @@ -name: Pre-releases with Gradle +name: Branch Builds on: push: paths-ignore: @@ -6,11 +6,26 @@ on: - '.all-contributorsrc' jobs: + test: + runs-on: ubuntu-latest + name: Test Processing + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Install Java + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build with Gradle + run: ./gradlew test build: - name: Create Pre-release for ${{ matrix.os_prefix }} (${{ matrix.arch }}) + name: (${{ matrix.os_prefix }}/${{ matrix.arch }}) Create Processing Build runs-on: ${{ matrix.os }} - permissions: - contents: write + needs: test strategy: fail-fast: false matrix: @@ -18,19 +33,31 @@ jobs: - os: ubuntu-24.04-arm os_prefix: linux arch: aarch64 + binary: processing*.snap - os: ubuntu-latest os_prefix: linux arch: x64 + binary: processing*.snap - os: windows-latest os_prefix: windows arch: x64 + binary: msi/Processing-*.msi - os: macos-latest os_prefix: macos arch: x64 + binary: dmg/Processing-*.dmg - os: macos-latest os_prefix: macos arch: aarch64 + binary: dmg/Processing-*.dmg steps: + - name: Install Snapcraft + if: runner.os == 'Linux' + uses: samuelmeuli/action-snapcraft@v3 + - name: Install LXD + if: runner.os == 'Linux' + uses: canonical/setup-lxd@main + - name: Checkout Repository uses: actions/checkout@v4 - name: Install Java @@ -41,32 +68,13 @@ jobs: architecture: ${{ matrix.arch }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 - - name: Install Snapcraft - if: runner.os == 'Linux' - uses: samuelmeuli/action-snapcraft@v3 - - name: Install LXD - if: runner.os == 'Linux' - uses: canonical/setup-lxd@main + - name: Build with Gradle run: ./gradlew packageDistributionForCurrentOS - - name: Add instructions - if: ${{ matrix.os_prefix == 'macos' }} - run: | - echo "run 'xattr -d com.apple.quarantine Processing-${version}.dmg' to remove the quarantine flag" > ./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt + - name: Add artifact uses: actions/upload-artifact@v4 with: - name: processing-${{ github.ref_name }}-${{github.sha}}-${{ matrix.os_prefix }}-${{ matrix.arch }}-gradle - path: | - ./app/build/compose/binaries/main/dmg/Processing-*.dmg - ./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt - ./app/build/compose/binaries/main/msi/Processing-*.msi - ./app/build/compose/binaries/main/deb/processing*.deb - retention-days: 1 - - name: Upload Snap - uses: actions/upload-artifact@v4 - with: - name: processing-${{ github.ref_name }}-${{github.sha}}-${{ matrix.os_prefix }}-${{ matrix.arch }}-snap - path: | - ./app/build/compose/binaries/main/processing*.snap + name: processing-${{ matrix.os_prefix }}-${{ matrix.arch }}-br_${{ github.ref_name }} retention-days: 1 + path: app/build/compose/binaries/main/${{ matrix.binary }} \ No newline at end of file diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index b66dcdeed..000000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Maven Release -on: - workflow_dispatch: - inputs: - version: - description: 'Version to release' - required: true - default: '1.0.0' - - -jobs: - publish: - name: Create Processing Core Release on Maven Central - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - name: Setup Java - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: 17 - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - - name: Build with Gradle - run: ./gradlew publish - env: - MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - - ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - - ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }} - ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }} - - ORG_GRADLE_PROJECT_version: ${{ github.event.inputs.version }} \ No newline at end of file diff --git a/.github/workflows/pull_request-gradle.yml b/.github/workflows/pull_request-gradle.yml index 11ae6f05a..8c8f6e054 100644 --- a/.github/workflows/pull_request-gradle.yml +++ b/.github/workflows/pull_request-gradle.yml @@ -7,12 +7,26 @@ on: - main jobs: - build: - name: Create Pull Request Build for ${{ matrix.os_prefix }} (${{ matrix.arch }}) + test: + runs-on: ubuntu-latest + name: Test Processing + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Install Java + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v4 + + - name: Build with Gradle + run: ./gradlew test + build: + name: (${{ matrix.os_prefix }}/${{ matrix.arch }}) Create Processing Build runs-on: ${{ matrix.os }} - permissions: - pull-requests: write - contents: read + needs: test strategy: fail-fast: false matrix: @@ -20,19 +34,31 @@ jobs: - os: ubuntu-24.04-arm os_prefix: linux arch: aarch64 + binary: processing*.snap - os: ubuntu-latest os_prefix: linux arch: x64 + binary: processing*.snap - os: windows-latest os_prefix: windows arch: x64 + binary: msi/Processing-*.msi - os: macos-latest os_prefix: macos arch: x64 + binary: dmg/Processing-*.dmg - os: macos-latest os_prefix: macos arch: aarch64 + binary: dmg/Processing-*.dmg steps: + - name: Install Snapcraft + if: runner.os == 'Linux' + uses: samuelmeuli/action-snapcraft@v3 + - name: Install LXD + if: runner.os == 'Linux' + uses: canonical/setup-lxd@main + - name: Checkout Repository uses: actions/checkout@v4 - name: Install Java @@ -43,19 +69,13 @@ jobs: architecture: ${{ matrix.arch }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + - name: Build with Gradle run: ./gradlew packageDistributionForCurrentOS - - name: Add instructions - if: ${{ matrix.os_prefix == 'macos' }} - run: | - echo "run 'xattr -d com.apple.quarantine Processing-${version}.dmg' to remove the quarantine flag" > ./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt + - name: Add artifact uses: actions/upload-artifact@v4 with: - name: processing-pr${{ github.event.pull_request.number }}-${{github.sha}}-${{ matrix.os_prefix }}-${{ matrix.arch }}-gradle - path: | - ./app/build/compose/binaries/main/dmg/Processing-*.dmg - ./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt - ./app/build/compose/binaries/main/msi/Processing-*.msi - ./app/build/compose/binaries/main/deb/processing*.deb + name: processing-${{ matrix.os_prefix }}-${{ matrix.arch }}-pr_${{ github.ref_name }} retention-days: 5 + path: app/build/compose/binaries/main/${{ matrix.binary }} \ No newline at end of file diff --git a/.github/workflows/release-gradle.yml b/.github/workflows/release-gradle.yml index fb7700cea..638757b0c 100644 --- a/.github/workflows/release-gradle.yml +++ b/.github/workflows/release-gradle.yml @@ -22,7 +22,7 @@ jobs: echo "build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT echo "version=$VERSION" >> $GITHUB_OUTPUT publish: - name: Publish Processing Core to Maven Central + name: Publish Processing Libraries to Maven Central runs-on: ubuntu-latest needs: version steps: @@ -35,6 +35,7 @@ jobs: java-version: 17 - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + - name: Build with Gradle run: ./gradlew publish env: @@ -50,7 +51,7 @@ jobs: ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }} ORG_GRADLE_PROJECT_group: ${{ vars.PROCESSING_GROUP }} build: - name: Publish Release for ${{ matrix.os_prefix }} (${{ matrix.arch }}) + name: (${{ matrix.os_prefix }}/${{ matrix.arch }}) Create Processing Release runs-on: ${{ matrix.os }} needs: version permissions: @@ -59,26 +60,42 @@ jobs: fail-fast: false matrix: include: - # compiling for arm32 needs a self-hosted runner on Raspi OS (32-bit) - - os: [self-hosted, linux, ARM] + - os: ubuntu-24.04-arm os_prefix: linux - arch: arm + arch: aarch64 + binary: processing_${{ needs.version.outputs.version }}_arm64.snap - os: ubuntu-latest os_prefix: linux arch: x64 + binary: processing_${{ needs.version.outputs.version }}_amd64.snap - os: windows-latest os_prefix: windows arch: x64 + binary: msi/Processing-${{ needs.version.outputs.version }}.msi - os: macos-latest os_prefix: macos arch: x64 + binary: dmg/Processing-${{ needs.version.outputs.version }}.dmg - os: macos-latest os_prefix: macos arch: aarch64 - - os: macos-latest - os_prefix: linux - arch: aarch64 + binary: dmg/Processing-${{ needs.version.outputs.version }}.dmg steps: + - name: Install Certificates for Code Signing + if: runner.os == 'macOS' + continue-on-error: true + uses: apple-actions/import-codesign-certs@v3 + with: + p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} + p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} + + - name: Install Snapcraft + if: runner.os == 'Linux' + uses: samuelmeuli/action-snapcraft@v3 + - name: Install LXD + if: runner.os == 'Linux' + uses: canonical/setup-lxd@main + - name: Checkout Repository uses: actions/checkout@v4 - name: Install Java @@ -89,12 +106,7 @@ jobs: architecture: ${{ matrix.arch }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 - # - name: Install Certificates for Code Signing - # if: ${{ matrix.os_prefix == 'macos' }} - # uses: apple-actions/import-codesign-certs@v3 - # with: - # p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} - # p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} + - name: Build with Gradle run: ./gradlew packageDistributionForCurrentOS env: @@ -105,9 +117,5 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: | - ./app/build/compose/binaries/main/dmg/Processing-*.dmg - ./app/build/compose/binaries/main/dmg/INSTRUCTIONS_FOR_TESTING.txt - ./app/build/compose/binaries/main/msi/Processing-*.msi - ./app/build/compose/binaries/main/deb/processing*.deb - file_glob: true + asset_name: processing-${{ needs.version.outputs.version }}-${{ matrix.os_prefix }}-${{ matrix.arch }} + file: app/build/compose/binaries/main/${{ matrix.binary }} \ No newline at end of file diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 1c1ea1024..d59cb367f 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -127,17 +127,33 @@ tasks.register("packageCustomDmg"){ dmg.parentFile.deleteRecursively() dmg.parentFile.mkdirs() + val extra = mutableListOf() + + if(!compose.desktop.application.nativeDistributions.macOS.signing.sign.get()) { + val content = """ + run 'xattr -d com.apple.quarantine Processing-${version}.dmg' to remove the quarantine flag + """.trimIndent() + val instructions = dmg.parentFile.resolve("INSTRUCTIONS.txt") + instructions.writeText(content) + extra.add("--add-file") + extra.add("INSTRUCTIONS.txt") + extra.add(instructions.path) + extra.add("200") + extra.add("25") + } + commandLine("brew", "install", "--quiet", "create-dmg") commandLine("create-dmg", "--volname", packageName, - "--volicon", rootProject.file("build/macos/processing.icns"), + "--volicon", file("macos/volume.icns"), "--background", file("macos/background.png"), "--icon", "$packageName.app", "200", "200", "--window-pos", "200", "200", "--window-size", "775", "485", "--app-drop-link", "500", "200", "--hide-extension", "$packageName.app", + *extra.toTypedArray(), dmg, app ) @@ -153,6 +169,7 @@ tasks.register("packageCustomMsi"){ "dotnet", "build", "/p:Platform=x64", + "/p:Version=$version", "/p:DefineConstants=\"Version=$version;\"" ) } diff --git a/app/macos/volume.icns b/app/macos/volume.icns new file mode 100644 index 000000000..cb42dad17 Binary files /dev/null and b/app/macos/volume.icns differ