Allow passing files across the client - SDK HTTP server bridge #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release on Push | |
| on: | |
| push: | |
| branches: [master] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build Settings UI | |
| run: | | |
| cd bridge-settings/react-app | |
| npm i | |
| npm run build:android | |
| - name: Build eSIM Frida Setup | |
| run: | | |
| cd frida | |
| npm i | |
| npm run build | |
| cd .. | |
| cp frida/dist/index.js bridge-system/src/main/jniLibs/arm64-v8a/libgadget.script.so | |
| - name: Download Frida Gadget | |
| run: | | |
| curl -L -o bridge-system/src/main/jniLibs/arm64-v8a/libgadget.so.xz https://github.com/frida/frida/releases/download/16.7.19/frida-gadget-16.7.19-android-arm64.so.xz | |
| xz --force --decompress bridge-system/src/main/jniLibs/arm64-v8a/libgadget.so.xz | |
| - name: Generate version for build | |
| run: | | |
| TODAY=$(date +'%Y-%m-%d') | |
| TODAY_CODE=$(date +'%Y%m%d') | |
| # Get all existing releases for today (fetch more to avoid pagination issues) | |
| EXISTING=$(gh release list --limit 100 --json tagName --jq '.[].tagName' | grep "^${TODAY}\." || echo "") | |
| if [ -z "$EXISTING" ]; then | |
| # No releases today, start with .0 | |
| BUILD_NUM=0 | |
| else | |
| # Find highest build number for today | |
| BUILD_NUM=$(echo "$EXISTING" | sed "s/^${TODAY}\.//" | sort -n | tail -1) | |
| BUILD_NUM=$((BUILD_NUM + 1)) | |
| fi | |
| echo "Existing releases for ${TODAY}: $EXISTING" | |
| echo "Next build number: $BUILD_NUM" | |
| VERSION_NAME="${TODAY}.${BUILD_NUM}" | |
| VERSION_CODE="${TODAY_CODE}${BUILD_NUM}" | |
| echo "Generated version name: $VERSION_NAME" | |
| echo "Generated version code: $VERSION_CODE" | |
| # Set environment variables for subsequent steps | |
| echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV | |
| echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Release APKs | |
| run: ./gradlew :bridge-core:assembleRelease :bridge-system:assembleRelease :bridge-shell:assembleRelease :bridge-settings:assembleRelease -PversionName="$VERSION_NAME" -PversionCode="$VERSION_CODE" | |
| - name: Rename APK files | |
| run: | | |
| # Create release artifacts directory | |
| mkdir -p release-artifacts | |
| # Rename actual APKs | |
| cp bridge-core/build/outputs/apk/release/bridge-core-release.apk release-artifacts/PenumbraOS-SDK-Bridge-Core-${VERSION_NAME}.apk | |
| cp bridge-system/build/outputs/apk/release/bridge-system-release.apk release-artifacts/PenumbraOS-SDK-Bridge-System-${VERSION_NAME}.apk | |
| cp bridge-shell/build/outputs/apk/release/bridge-shell-release.apk release-artifacts/PenumbraOS-SDK-Bridge-Shell-${VERSION_NAME}.apk | |
| cp bridge-settings/build/outputs/apk/release/bridge-settings-release.apk release-artifacts/PenumbraOS-SDK-Bridge-Settings-${VERSION_NAME}.apk | |
| - name: Generate version tag | |
| id: version | |
| run: | | |
| TODAY=$(date +'%Y-%m-%d') | |
| # Get all existing releases for today (fetch more to avoid pagination issues) | |
| EXISTING=$(gh release list --limit 100 --json tagName --jq '.[].tagName' | grep "^${TODAY}\." || echo "") | |
| if [ -z "$EXISTING" ]; then | |
| # No releases today, start with .0 | |
| BUILD_NUM=0 | |
| else | |
| # Find highest build number for today | |
| BUILD_NUM=$(echo "$EXISTING" | sed "s/^${TODAY}\.//" | sort -n | tail -1) | |
| BUILD_NUM=$((BUILD_NUM + 1)) | |
| fi | |
| echo "Existing releases for ${TODAY}: $EXISTING" | |
| echo "Next build number: $BUILD_NUM" | |
| VERSION="${TODAY}.${BUILD_NUM}" | |
| echo "tag=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Generated version: $VERSION" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Prerelease | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.VERSION_NAME }} | |
| name: Alpha ${{ env.VERSION_NAME }} | |
| prerelease: true | |
| generate_release_notes: true | |
| files: release-artifacts/* | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |