From 9b17920f7edde018854332879c79570293041e7b Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Sat, 3 Oct 2026 12:47:44 +0000 Subject: [PATCH] fdroid: split into sync and submit workflows Sync pulls fdroiddata's current recipe into tools/fdroid/ (refusing to clobber unsubmitted moves). Submit refuses when upstream has moved since the last sync or when there is nothing to submit, then pushes this repo's copy to the GitLab fork on a branch based on current upstream and opens the MR. Drops the API-overwrite script. --- tools/fdroid-submit.nu | 64 ----- tools/fdroid/com.subtracks.upstream.yml | 366 ++++++++++++++++++++++++ 2 files changed, 366 insertions(+), 64 deletions(-) delete mode 100644 tools/fdroid-submit.nu create mode 100644 tools/fdroid/com.subtracks.upstream.yml diff --git a/tools/fdroid-submit.nu b/tools/fdroid-submit.nu deleted file mode 100644 index eaea54b3..00000000 --- a/tools/fdroid-submit.nu +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env nu - -# Submit a build recipe to fdroiddata via the GitLab API, without cloning it. -# -# nix develop --command nu tools/fdroid-submit.nu -# -# Reads a recipe from tools/fdroid/.yml, pushes it to a branch on the -# fork and opens or updates the merge request against fdroid/fdroiddata. Needs -# a GitLab personal access token with the 'api' scope in GL_TOKEN. -# -# The branch is created from the fork's master, which drifts from upstream. If -# upstream has since edited the same recipe the MR conflicts and the fork must -# be synced (GitLab's "Update fork") before running this again. - -const FORK = "austinried/fdroiddata" -const UPSTREAM = "fdroid/fdroiddata" -const BASE_BRANCH = "master" - -def pct-encode [s: string] { $s | str replace -a "/" "%2F" } - -def main [ - recipe: path = "tools/fdroid/com.subtracks.yml" - --api: string = "https://gitlab.com/api/v4" - --dry-run -] { - if not ($recipe | path exists) { - error make { msg: $"recipe not found: ($recipe)" } - } - - let appid = ($recipe | path basename | str replace -r '\.ya?ml$' '') - let branch = $"($appid)-recipe" - let title = $"($appid): update build recipe" - let file_path = (pct-encode $"metadata/($appid).yml") - let fork = (pct-encode $FORK) - let upstream = (pct-encode $UPSTREAM) - - if $dry_run { - print $"would push ($recipe) to ($FORK)@($branch) and open an MR against ($UPSTREAM)@($BASE_BRANCH)" - return - } - - let token = ($env.GL_TOKEN? | default "") - if ($token | is-empty) { - error make { msg: "GL_TOKEN is unset; it needs a GitLab token with the 'api' scope" } - } - let headers = { "PRIVATE-TOKEN": $token } - let upstream_id = (http get $"($api)/projects/($upstream)" | get id) - - let branch_exists = (try { http get $"($api)/projects/($fork)/repository/branches/($branch)" --headers $headers } catch { null }) | is-not-empty - if not $branch_exists { - http post $"($api)/projects/($fork)/repository/branches" ({ branch: $branch, ref: $BASE_BRANCH } | to json) --headers $headers --content-type "application/json" | ignore - } - - http put $"($api)/projects/($fork)/repository/files/($file_path)" ({ branch: $branch, content: (open --raw $recipe), commit_message: $title } | to json) --headers $headers --content-type "application/json" | ignore - - let open = (http get $"($api)/projects/($fork)/merge_requests?state=opened&source_branch=($branch)&target_branch=($BASE_BRANCH)" --headers $headers) - if ($open | is-not-empty) { - print $"updated MR !($open.0.iid): ($open.0.web_url)" - return - } - - let mr = (http post $"($api)/projects/($fork)/merge_requests" ({ source_branch: $branch, target_branch: $BASE_BRANCH, target_project_id: $upstream_id, title: $title, remove_source_branch: true } | to json) --headers $headers --content-type "application/json") - print $"opened MR !($mr.iid): ($mr.web_url)" -} diff --git a/tools/fdroid/com.subtracks.upstream.yml b/tools/fdroid/com.subtracks.upstream.yml new file mode 100644 index 00000000..67ca7792 --- /dev/null +++ b/tools/fdroid/com.subtracks.upstream.yml @@ -0,0 +1,366 @@ +Categories: + - Multimedia +License: GPL-3.0-only +AuthorName: austinried +AuthorEmail: subtracks@functionkey.xyz +WebSite: https://github.com/austinried/subtracks +SourceCode: https://github.com/austinried/subtracks +IssueTracker: https://github.com/austinried/subtracks/issues +Donate: https://ko-fi.com/austinried + +AutoName: Subtracks + +RepoType: git +Repo: https://github.com/austinried/subtracks + +Builds: + - versionName: 1.0.1 + versionCode: 3 + commit: v1.0.1 + subdir: android/app + sudo: + - sysctl fs.inotify.max_user_watches=524288 + - curl -Lo node.tar.xz https://nodejs.org/dist/v14.17.5/node-v14.17.5-linux-x64.tar.xz + - echo "2d759de07a50cd7f75bd73d67e97b0d0e095ee3c413efac7d1b3d1e84ed76fff node.tar.xz" + | sha256sum -c - + - tar xJf node.tar.xz + - cp -a node-v14.17.5-linux-x64/. /usr/local/ + - npm -g install yarn + gradle: + - yes + srclibs: + - react-native-reanimated@2.2.0 + prebuild: + - echo -e '\norg.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=4g' >> ../gradle.properties + - echo -e "android { packagingOptions { pickFirst 'lib/**/*.so' } }" >> build.gradle + - cd ../.. + - yarn install + - cd $$react-native-reanimated$$ + - echo -e "android { ndkVersion '21.4.7075529' }" >> build.gradle + - yarn add react-native@0.64.1 + scanignore: + - android/build.gradle + - node_modules/jsc-android + - node_modules/hermes-engine + - node_modules/react-native/android/com/facebook/react/react-native/*/ + - node_modules/react-native-safe-area-context/android/build.gradle + - node_modules/react-native-screens/android/build.gradle + - node_modules/react-native-webview/android/build.gradle + - node_modules/react-native/template/android/build.gradle + - node_modules/react-native-image-colors/android/build.gradle + - node_modules/react-native-track-player/android/build.gradle + - node_modules/react-native-vector-icons/android/build.gradle + - node_modules/@react-native-async-storage/async-storage/android/build.gradle + - node_modules/@react-native-community/masked-view/android/build.gradle + - node_modules/@react-native-community/netinfo/android/build.gradle + scandelete: + - node_modules + build: + - pushd $$react-native-reanimated$$ + - FOR_HERMES=True gradle :assembleRelease + - popd + - mv $$react-native-reanimated$$/build/outputs/aar/android-release.aar + ../../node_modules/react-native-reanimated/android/react-native-reanimated-64-hermes.aar + ndk: r21e + + - versionName: 1.1.0 + versionCode: 4 + commit: v1.1.0 + subdir: android/app + submodules: true + sudo: + - sysctl fs.inotify.max_user_watches=524288 + - curl -Lo node.tar.xz https://nodejs.org/dist/v14.17.5/node-v14.17.5-linux-x64.tar.xz + - echo "2d759de07a50cd7f75bd73d67e97b0d0e095ee3c413efac7d1b3d1e84ed76fff node.tar.xz" + | sha256sum -c - + - tar xJf node.tar.xz + - cp -a node-v14.17.5-linux-x64/. /usr/local/ + - npm -g install yarn + gradle: + - yes + srclibs: + - react-native-reanimated@2.2.0 + prebuild: + - echo -e '\norg.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=4g' >> ../gradle.properties + - echo -e "android { packagingOptions { pickFirst 'lib/**/*.so' } }" >> build.gradle + - cd ../.. + - mkdir .yarncache + - yarn install --cache-folder ./.yarncache + - rm -rf .yarncache + - cd $$react-native-reanimated$$ + - echo -e "android { ndkVersion '21.4.7075529' }" >> build.gradle + - yarn add react-native@0.64.1 + scanignore: + - android/build.gradle + - node_modules/jsc-android + - node_modules/hermes-engine + - node_modules/react-native/android/com/facebook/react/react-native/*/ + - node_modules/react-native-safe-area-context/android/build.gradle + - node_modules/react-native-screens/android/build.gradle + - node_modules/react-native-webview/android/build.gradle + - node_modules/react-native/template/android/build.gradle + - node_modules/react-native-image-colors/android/build.gradle + - node_modules/react-native-track-player/android/build.gradle + - node_modules/react-native-vector-icons/android/build.gradle + - node_modules/@react-native-async-storage/async-storage/android/build.gradle + - node_modules/@react-native-community/masked-view/android/build.gradle + - node_modules/@react-native-community/netinfo/android/build.gradle + scandelete: + - node_modules + - submodules + build: + - ../../scripts/prepare-exoplayer-ffmpeg.sh + - pushd $$react-native-reanimated$$ + - FOR_HERMES=True gradle :assembleRelease + - popd + - mv $$react-native-reanimated$$/build/outputs/aar/android-release.aar + ../../node_modules/react-native-reanimated/android/react-native-reanimated-64-hermes.aar + ndk: r21e + + - versionName: 1.1.1 + versionCode: 5 + commit: 336e106e0152a479490a6c619fc0ee53461a2cd8 + subdir: android/app + submodules: true + sudo: + - sysctl fs.inotify.max_user_watches=524288 + - curl -Lo node.tar.xz https://nodejs.org/dist/v14.17.5/node-v14.17.5-linux-x64.tar.xz + - echo "2d759de07a50cd7f75bd73d67e97b0d0e095ee3c413efac7d1b3d1e84ed76fff node.tar.xz" + | sha256sum -c - + - tar xJf node.tar.xz + - cp -a node-v14.17.5-linux-x64/. /usr/local/ + - npm -g install yarn + gradle: + - yes + srclibs: + - react-native-reanimated@2.2.0 + prebuild: + - echo -e '\norg.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=4g' >> ../gradle.properties + - echo -e "android { packagingOptions { pickFirst 'lib/**/*.so' } }" >> build.gradle + - cd ../.. + - mkdir .yarncache + - yarn install --cache-folder ./.yarncache + - rm -rf .yarncache + - cd $$react-native-reanimated$$ + - echo -e "android { ndkVersion '21.4.7075529' }" >> build.gradle + - yarn add react-native@0.64.1 + scanignore: + - android/build.gradle + - node_modules/jsc-android + - node_modules/hermes-engine + - node_modules/react-native/android/com/facebook/react/react-native/*/ + - node_modules/react-native-safe-area-context/android/build.gradle + - node_modules/react-native-screens/android/build.gradle + - node_modules/react-native-webview/android/build.gradle + - node_modules/react-native/template/android/build.gradle + - node_modules/react-native-image-colors/android/build.gradle + - node_modules/react-native-track-player/android/build.gradle + - node_modules/react-native-vector-icons/android/build.gradle + - node_modules/@react-native-async-storage/async-storage/android/build.gradle + - node_modules/@react-native-community/masked-view/android/build.gradle + - node_modules/@react-native-community/netinfo/android/build.gradle + scandelete: + - node_modules + - submodules + build: + - ../../scripts/prepare-exoplayer-ffmpeg.sh + - pushd $$react-native-reanimated$$ + - FOR_HERMES=True gradle :assembleRelease + - popd + - mv $$react-native-reanimated$$/build/outputs/aar/android-release.aar + ../../node_modules/react-native-reanimated/android/react-native-reanimated-64-hermes.aar + ndk: r21e + + - versionName: 1.1.3 + versionCode: 7 + commit: 5a2ab98af55764c0ef4c73d2640a2d8c5c3b0609 + subdir: android/app + submodules: true + sudo: + - sysctl fs.inotify.max_user_watches=524288 + - curl -Lo node.tar.xz https://nodejs.org/dist/v14.17.5/node-v14.17.5-linux-x64.tar.xz + - echo "2d759de07a50cd7f75bd73d67e97b0d0e095ee3c413efac7d1b3d1e84ed76fff node.tar.xz" + | sha256sum -c - + - tar xJf node.tar.xz + - cp -a node-v14.17.5-linux-x64/. /usr/local/ + - npm -g install yarn + - apt-get update + - apt-get install -y wget + - apt-get install -y openjdk-11-jdk-headless + - update-alternatives --auto java + gradle: + - yes + srclibs: + - react-native-reanimated@2.3.1 + prebuild: + - echo -e '\norg.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=4g' >> ../gradle.properties + - echo -e "android { packagingOptions { pickFirst 'lib/**/*.so' } }" >> build.gradle + - cd ../.. + - mkdir .yarncache + - yarn install --network-concurrency 1 --cache-folder ./.yarncache + - rm -rf .yarncache + - cd $$react-native-reanimated$$ + - echo -e "android { ndkVersion '21.4.7075529' }" >> build.gradle + - yarn add react-native@0.67.1 + scanignore: + - android/build.gradle + - node_modules/jsc-android + - node_modules/hermes-engine + - node_modules/react-native/android/com/facebook/react/react-native/*/ + - node_modules/react-native-safe-area-context/android/build.gradle + - node_modules/react-native-screens/android/build.gradle + - node_modules/react-native-webview/android/build.gradle + - node_modules/react-native/template/android/build.gradle + - node_modules/react-native-image-colors/android/build.gradle + - node_modules/react-native-get-random-values/android/build.gradle + - node_modules/react-native-track-player/android/build.gradle + - node_modules/react-native-vector-icons/android/build.gradle + - node_modules/@react-native-async-storage/async-storage/android/build.gradle + - node_modules/@react-native-community/masked-view/android/build.gradle + - node_modules/@react-native-community/netinfo/android/build.gradle + scandelete: + - node_modules + - submodules + build: + - ../../scripts/prepare-exoplayer-ffmpeg.sh + - pushd $$react-native-reanimated$$ + - FOR_HERMES=True gradle :assembleRelease + - popd + - mv $$react-native-reanimated$$/build/outputs/aar/android-release.aar + ../../node_modules/react-native-reanimated/android/react-native-reanimated-67-hermes.aar + - pushd $$react-native-reanimated$$ + - gradle :assembleRelease + - popd + - mv $$react-native-reanimated$$/build/outputs/aar/android-release.aar + ../../node_modules/react-native-reanimated/android/react-native-reanimated-67-jsc.aar + ndk: r21e + + - versionName: 1.2.0 + versionCode: 8 + commit: 4905f75564bf8f6b96597a91d3d8f39b1551a56e + subdir: android/app + submodules: true + sudo: + - sysctl fs.inotify.max_user_watches=524288 + - curl -Lo node.tar.xz https://nodejs.org/dist/v14.17.5/node-v14.17.5-linux-x64.tar.xz + - echo "2d759de07a50cd7f75bd73d67e97b0d0e095ee3c413efac7d1b3d1e84ed76fff node.tar.xz" + | sha256sum -c - + - tar xJf node.tar.xz --strip-components=1 -C /usr/local/ + - npm -g install yarn + - apt-get update + - apt-get install -y openjdk-11-jdk-headless + - update-alternatives --auto java + gradle: + - yes + srclibs: + - react-native-reanimated@2.3.1 + prebuild: + - echo -e '\norg.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=4g' >> ../gradle.properties + - echo -e "android { packagingOptions { pickFirst 'lib/**/*.so' } }" >> build.gradle + - cd ../.. + - mkdir .yarncache + - yarn install --network-concurrency 1 --cache-folder ./.yarncache + - rm -rf .yarncache + - cd $$react-native-reanimated$$ + - echo -e "android { ndkVersion '21.4.7075529' }" >> build.gradle + - yarn add react-native@0.67.4 + scanignore: + - android/build.gradle + - node_modules/jsc-android + - node_modules/hermes-engine + - node_modules/react-native/android/com/facebook/react/react-native/*/ + - node_modules/react-native-safe-area-context/android/build.gradle + - node_modules/react-native-screens/android/build.gradle + - node_modules/react-native-webview/android/build.gradle + - node_modules/react-native/template/android/build.gradle + - node_modules/react-native-image-colors/android/build.gradle + - node_modules/react-native-blob-util/android/build.gradle + - node_modules/react-native-track-player/android/build.gradle + - node_modules/react-native-vector-icons/android/build.gradle + - node_modules/@react-native-async-storage/async-storage/android/build.gradle + - node_modules/@react-native-community/masked-view/android/build.gradle + - node_modules/@react-native-community/netinfo/android/build.gradle + scandelete: + - node_modules + - submodules + build: + - ../../scripts/prepare-exoplayer-ffmpeg.sh + - pushd $$react-native-reanimated$$ + - FOR_HERMES=True gradle :assembleRelease + - popd + - mv $$react-native-reanimated$$/build/outputs/aar/android-release.aar + ../../node_modules/react-native-reanimated/android/react-native-reanimated-67-hermes.aar + - pushd $$react-native-reanimated$$ + - gradle :assembleRelease + - popd + - mv $$react-native-reanimated$$/build/outputs/aar/android-release.aar + ../../node_modules/react-native-reanimated/android/react-native-reanimated-67-jsc.aar + ndk: r21e + + - versionName: 1.3.0 + versionCode: 9 + commit: 2bf3e8853de705bb49aa4175b1ad5a9b5bb431b2 + subdir: android/app + submodules: true + sudo: + - sysctl fs.inotify.max_user_watches=524288 + - curl -Lo node.tar.xz https://nodejs.org/dist/v14.17.5/node-v14.17.5-linux-x64.tar.xz + - echo "2d759de07a50cd7f75bd73d67e97b0d0e095ee3c413efac7d1b3d1e84ed76fff node.tar.xz" + | sha256sum -c - + - tar xJf node.tar.xz --strip-components=1 -C /usr/local/ + - npm -g install yarn + - apt-get update + - apt-get install -y openjdk-11-jdk-headless + - update-alternatives --auto java + gradle: + - yes + srclibs: + - react-native-reanimated@2.3.1 + prebuild: + - echo -e '\norg.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=4g' >> ../gradle.properties + - echo -e "android { packagingOptions { pickFirst 'lib/**/*.so' } }" >> build.gradle + - cd ../.. + - mkdir .yarncache + - yarn install --network-concurrency 1 --cache-folder ./.yarncache + - rm -rf .yarncache + - cd $$react-native-reanimated$$ + - echo -e "android { ndkVersion '21.4.7075529' }" >> build.gradle + - yarn add react-native@0.67.4 + scanignore: + - android/build.gradle + - node_modules/jsc-android + - node_modules/hermes-engine + - node_modules/react-native/android/com/facebook/react/react-native/*/ + - node_modules/react-native-safe-area-context/android/build.gradle + - node_modules/react-native-screens/android/build.gradle + - node_modules/react-native-webview/android/build.gradle + - node_modules/react-native/template/android/build.gradle + - node_modules/react-native-image-colors/android/build.gradle + - node_modules/react-native-blob-util/android/build.gradle + - node_modules/react-native-localize/android/build.gradle + - node_modules/react-native-track-player/android/build.gradle + - node_modules/react-native-vector-icons/android/build.gradle + - node_modules/@react-native-async-storage/async-storage/android/build.gradle + - node_modules/@react-native-community/masked-view/android/build.gradle + - node_modules/@react-native-community/netinfo/android/build.gradle + scandelete: + - node_modules + - submodules + build: + - ../../scripts/prepare-exoplayer-ffmpeg.sh + - pushd $$react-native-reanimated$$ + - FOR_HERMES=True gradle :assembleRelease + - popd + - mv $$react-native-reanimated$$/build/outputs/aar/android-release.aar + ../../node_modules/react-native-reanimated/android/react-native-reanimated-67-hermes.aar + - pushd $$react-native-reanimated$$ + - gradle :assembleRelease + - popd + - mv $$react-native-reanimated$$/build/outputs/aar/android-release.aar + ../../node_modules/react-native-reanimated/android/react-native-reanimated-67-jsc.aar + ndk: r21e + +AutoUpdateMode: Version +UpdateCheckMode: Tags +CurrentVersion: 1.3.0 +CurrentVersionCode: 9