diff --git a/.github/workflows/build-gradle.yml b/.github/workflows/build-gradle.yml index e53355d29..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,31 +6,58 @@ 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: include: - - os: [self-hosted, linux, ARM64] + - 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,19 +68,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-${{ 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 + 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..4ea0bcc9d 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.event.pull_request.number }} 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..36a18e67a 100644 --- a/.github/workflows/release-gradle.yml +++ b/.github/workflows/release-gradle.yml @@ -7,22 +7,48 @@ jobs: version: runs-on: ubuntu-latest outputs: - build_number: ${{ steps.tag_info.outputs.build_number }} + revision: ${{ steps.tag_info.outputs.revision }} version: ${{ steps.tag_info.outputs.version }} steps: - - name: Extract version and build number + - name: Extract version and revision id: tag_info shell: bash run: | TAG_NAME="${GITHUB_REF#refs/tags/}" - BUILD_NUMBER=$(echo "$TAG_NAME" | cut -d'-' -f2) + REVISION=$(echo "$TAG_NAME" | cut -d'-' -f2) VERSION=$(echo "$TAG_NAME" | cut -d'-' -f3) # Set outputs for use in later jobs or steps - echo "build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT + echo "revision=$REVISION" >> $GITHUB_OUTPUT echo "version=$VERSION" >> $GITHUB_OUTPUT + reference: + name: Publish Processing Reference to release + runs-on: ubuntu-latest + needs: version + steps: + - name: Checkout Website Repository + uses: actions/checkout@v4 + with: + repository: processing/processing-website + - name: Use Node.js 16 + uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Install dependencies + run: npm ci + - name: Build + run: npm run build + - name: Make reference.zip + run: npm run zip + - name: Upload reference to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + asset_name: processing-${{ needs.version.outputs.version }}-reference.zip + file: reference.zip + publish: - name: Publish Processing Core to Maven Central + name: Publish Processing Libraries to Maven Central runs-on: ubuntu-latest needs: version steps: @@ -35,6 +61,7 @@ jobs: java-version: 17 - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 + - name: Build with Gradle run: ./gradlew publish env: @@ -48,9 +75,9 @@ jobs: ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }} ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }} - ORG_GRADLE_PROJECT_group: ${{ vars.PROCESSING_GROUP }} + ORG_GRADLE_PROJECT_group: ${{ vars.GRADLE_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 +86,47 @@ 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: ${{ vars.SNAP_NAME }}_${{ needs.version.outputs.version }}_arm64 + extension: snap - os: ubuntu-latest os_prefix: linux arch: x64 + binary: ${{ vars.SNAP_NAME }}_${{ needs.version.outputs.version }}_amd64 + extension: snap - os: windows-latest os_prefix: windows arch: x64 + binary: msi/Processing-${{ needs.version.outputs.version }} + extension: msi - os: macos-latest os_prefix: macos arch: x64 + binary: dmg/Processing-${{ needs.version.outputs.version }} + extension: dmg - os: macos-latest os_prefix: macos arch: aarch64 - - os: macos-latest - os_prefix: linux - arch: aarch64 + binary: dmg/Processing-${{ needs.version.outputs.version }} + extension: 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,25 +137,37 @@ 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: + env: ORG_GRADLE_PROJECT_version: ${{ needs.version.outputs.version }} - ORG_GRADLE_PROJECT_group: ${{ vars.PROCESSING_GROUP }} + ORG_GRADLE_PROJECT_group: ${{ vars.GRADLE_GROUP }} + ORG_GRADLE_PROJECT_revision: ${{ needs.version.outputs.revision }} + ORG_GRADLE_PROJECT_compose.desktop.verbose: true + ORG_GRADLE_PROJECT_compose.desktop.mac.sign: ${{ secrets.PROCESSING_SIGNING }} + ORG_GRADLE_PROJECT_compose.desktop.mac.signing.identity: ${{ secrets.PROCESSING_SIGNING_IDENTITY }} + ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.appleID: ${{ secrets.PROCESSING_APPLE_ID }} + ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.password: ${{ secrets.PROCESSING_APP_PASSWORD }} + ORG_GRADLE_PROJECT_compose.desktop.mac.notarization.teamID: ${{ secrets.PROCESSING_TEAM_ID }} + ORG_GRADLE_PROJECT_snapname: ${{ vars.SNAP_NAME }} - - name: Upload binaries to release + - name: Upload portables to release 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 }}-portable.zip + file: app/build/compose/binaries/main/Processing-${{ needs.version.outputs.version }}.zip + + - name: Upload installers to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + asset_name: processing-${{ needs.version.outputs.version }}-${{ matrix.os_prefix }}-${{ matrix.arch }}.${{ matrix.extension }} + file: app/build/compose/binaries/main/${{ matrix.binary }}.${{ matrix.extension }} + + - name: Upload snap to Snap Store + if: runner.os == 'Linux' + run: snapcraft upload --release=beta app/build/compose/binaries/main/${{ matrix.binary }}.${{ matrix.extension }} + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.PROCESSING_SNAPCRAFT_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index ebdb29b67..7faa26d70 100644 --- a/.gitignore +++ b/.gitignore @@ -112,3 +112,4 @@ java/build/ /core/examples/build .build/ +/app/windows/obj diff --git a/.idea/icon.svg b/.idea/icon.svg new file mode 100644 index 000000000..149e0a180 --- /dev/null +++ b/.idea/icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/.idea/runConfigurations/Processing.xml b/.idea/runConfigurations/Processing.xml index 0c7c99651..648638250 100644 --- a/.idea/runConfigurations/Processing.xml +++ b/.idea/runConfigurations/Processing.xml @@ -4,7 +4,6 @@