processing / processing/processing4

CI/CD Actions for compiling apps on Github Actions using processing android

オープン
#1,011 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Java
スター
494
フォーク
183
平均マージ
4時間 39分
マージ済み PR(30日)
3

説明

Currently, there aren’t any existing GitHub Actions to automatically build desktop and mobile apps from Processing .pde code. I’ve been working on setting one up, as you can see from the build.yml file attached. However, I’m running into an issue determining the correct folder that Processing considers its "sketchbook" directory. This is important because the Android libraries need to be placed there for the project to build successfully.

I would really appreciate your guidance in fixing this. Having a working GitHub Actions setup for Processing sketches, games, and apps could benefit the entire Processing community by enabling automated builds. Not to mention many app stores for libre software won't accept software without reproducible builds using CI/CD actions.

Link to my test project: https://github.com/ronynn/spark


name: Build Processing Android APK

on:
  push:
    tags:
      - "alpha"
      - "beta"
      - "release*"

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Install OpenJDK
        run: |
          sudo apt-get update && sudo apt-get install -y openjdk-17-jdk

      - name: Install Processing CLI
        run: |
          wget https://github.com/processing/processing4/releases/download/processing-1297-4.3.4/processing-4.3.4-linux-x64.tgz -O processing.tgz
          tar -xzf processing.tgz
          sudo mv processing-4.3.4 /opt/processing

      - name: Debug Repository Structure
        run: ls -R $GITHUB_WORKSPACE

      - name: Install Android SDK
        run: |
          sudo apt-get install -y unzip
          wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O sdk-tools.zip
          mkdir -p $HOME/android-sdk/cmdline-tools
          unzip sdk-tools.zip -d $HOME/android-sdk/cmdline-tools
          mv $HOME/android-sdk/cmdline-tools/cmdline-tools $HOME/android-sdk/cmdline-tools/latest
          echo "ANDROID_HOME=$HOME/android-sdk" >> $GITHUB_ENV
          echo "PATH=$ANDROID_HOME/cmdline-tools/latest/bin:$ANDROID_HOME/platform-tools:$PATH" >> $GITHUB_ENV
          yes | $HOME/android-sdk/cmdline-tools/latest/bin/sdkmanager --sdk_root=$HOME/android-sdk "platform-tools" "build-tools;34.0.0" "platforms;android-34"
          yes | $HOME/android-sdk/cmdline-tools/latest/bin/sdkmanager --licenses

      - name: Install Processing Android Mode and Setup Sketchbook
        run: |
          # Create a custom sketchbook folder with both modes and libraries directories.
          mkdir -p $HOME/sketchbook/modes
          mkdir -p $HOME/sketchbook/libraries
          wget https://github.com/processing/processing-android/releases/download/latest/AndroidMode.zip -O AndroidMode.zip
          unzip AndroidMode.zip -d $HOME/sketchbook/modes/
          # If the Android Mode package contains libraries (commonly in modes/AndroidMode/libraries),
          # copy them into the sketchbook libraries folder so Processing can find them.
          if [ -d "$HOME/sketchbook/modes/AndroidMode/libraries" ]; then
            cp -r $HOME/sketchbook/modes/AndroidMode/libraries/* $HOME/sketchbook/libraries/
          fi
          echo "PROCESSING_SKETCHBOOK=$HOME/sketchbook" >> $GITHUB_ENV
          echo "Sketchbook structure:" 
          ls -R $HOME/sketchbook

      - name: Generate Android Project
        run: |
          /opt/processing/processing-java \
            --sketch=$GITHUB_WORKSPACE/spark \
            --output=$GITHUB_WORKSPACE/build \
            --force --export --variant android \
            --sketchbook=$HOME/sketchbook

      - name: Build APK (Ant)
        run: |
          cd $GITHUB_WORKSPACE/build/android
          ant debug
          ant release

      - name: Upload Debug APK as Artifact
        uses: actions/upload-artifact@v4
        with:
          name: Processing-Android-APK-Debug
          path: build/android/bin/app-debug.apk

      - name: Upload Unsigned APK as Artifact
        uses: actions/upload-artifact@v4
        with:
          name: Processing-Android-APK-Unsigned
          path: build/android/bin/app-release-unsigned.apk

      - name: Create GitHub Release (Only for Release Tags)
        if: startsWith(github.ref, 'refs/tags/release')
        uses: softprops/action-gh-release@v1
        with:
          tag_name: ${{ github.ref_name }}
          name: Processing APK - ${{ github.ref_name }}
          draft: false
          prerelease: false
          files: |
            build/android/bin/app-debug.apk
            build/android/bin/app-release-unsigned.apk
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

issue 内の build.yml workflow と processing-java の呼び出しから始め、特に --sketchbook パスと Android Mode のセットアップを確認してください。Processing が想定する sketchbook ディレクトリとライブラリの配置を確認し、リンクされている spark プロジェクトに対して workflow をテストしてください。GitHub Actions の実行によって Android APK アーティファクトを再現性のある形で生成およびビルドできれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, github-actions, java
領域
build-system, ci-cd, mobile
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
30/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。