Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Reproducible Builds for F-Droid #293

Merged
merged 27 commits into from
Oct 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
cf5b81d
fix: fix wrong version mapping, add f-droid build script
astubenbord Oct 24, 2023
b1435ba
feat: Update flutter submodule version to 3.13.3
astubenbord Oct 25, 2023
1842309
feat: Update build
astubenbord Oct 25, 2023
f12f96d
feat: Bump version, add changelogs
astubenbord Oct 25, 2023
b50db64
fix: Update path to flutter submodule
astubenbord Oct 25, 2023
f27df82
fix: Update build
astubenbord Oct 25, 2023
0e5e89b
fix: Update build
astubenbord Oct 25, 2023
53919dc
fix: Update build
astubenbord Oct 25, 2023
300a0be
fix: Update build
astubenbord Oct 26, 2023
2f81cbe
feat: update build
astubenbord Oct 26, 2023
13d1694
fix: update build
astubenbord Oct 26, 2023
bf601c8
fix: update build
astubenbord Oct 26, 2023
f1f36c9
feat: Add test action
astubenbord Oct 26, 2023
eb5e3c9
fix: Update test action
astubenbord Oct 26, 2023
0a6d3f4
fix: Update test action
astubenbord Oct 26, 2023
9129388
fix: Update test action
astubenbord Oct 26, 2023
8fc4c02
fix: Update test action
astubenbord Oct 26, 2023
4230b5b
fix: Update test action
astubenbord Oct 26, 2023
1443614
fix: Update test action
astubenbord Oct 26, 2023
d611f4b
fix: Update test action
astubenbord Oct 26, 2023
ddf06f3
fix: Update test action
astubenbord Oct 26, 2023
0f7e039
feat: update build
astubenbord Oct 26, 2023
1bd5b21
feat: update build
astubenbord Oct 26, 2023
d785edc
feat: update build
astubenbord Oct 26, 2023
af4359c
chore: Cleanup project structure, add debug output to build.gradle
astubenbord Oct 27, 2023
5bd5964
chore: remove debug statements
astubenbord Oct 27, 2023
a72f96e
chore: Remove unused action
astubenbord Oct 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/actions/setup-android-signing-config/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
keystore-store-password:
description: 'key.properties storePassword'
required: true
output-directory:
description: The directory of the project
required: true

runs:
using: "composite"
steps:
Expand All @@ -26,5 +30,7 @@ runs:
echo "keyAlias=${{ inputs.keystore-key-alias }}" >> key.properties
echo "storePassword=${{ inputs.keystore-store-password }}" >> key.properties
echo "keyPassword=${{ inputs.keystore-key-password }}" >> key.properties
cp key.properties ${{ inputs.output-directory }}/key.properties
cp app/${{ inputs.keystore-key-alias }}-keystore.jks ${{ inputs.output-directory }}/app
shell: bash
working-directory: android
42 changes: 26 additions & 16 deletions .github/workflows/create-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,30 @@ jobs:
runs-on: ubuntu-latest
steps:
# Setup Ruby, Bundler, and Gemfile dependencies

- name: Create build directory
run: mkdir -p /tmp/build

- name: Extract branch name
shell: bash
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT
id: extract_branch

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

- name: Clone flutter repository
uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.3'
channel: stable
- run: flutter doctor -v
fetch-depth: 0
submodules: recursive

- name: Copy files to build directory
run: |
mkdir -p /tmp/build
cp -R . /tmp/build

- name: Set FLUTTER_ROOT environment variable and build dir
run: echo "FLUTTER_ROOT=/tmp/build/flutter/bin" >> $GITHUB_ENV

- run: $FLUTTER_ROOT/flutter doctor -v

- name: Setup signing config
uses: ./.github/actions/setup-android-signing-config
with:
Expand All @@ -41,21 +49,23 @@ jobs:
keystore-store-password: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
release-keystore: ${{ secrets.RELEASE_KEYSTORE }}
release-keystore-passphrase: ${{ secrets.RELEASE_KEYSTORE_PASSPHRASE }}

output-directory: /tmp/build/android

- name: Get packages and run codegen
run: |
bash install_dependencies.sh
bash update_changelogs.sh
working-directory: scripts
bash /tmp/build/scripts/install_dependencies_with_submodule.sh
bash /tmp/build/scripts/update_changelogs.sh

- name: Setup Fastlane
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.6"
bundler-cache: true
working-directory: android

- run: bundle exec fastlane github branch:${{ steps.extract_branch.outputs.branch }} is_draft:${{ github.event.inputs.is_draft }}
working-directory: /tmp/build/android

- name: Build and publish GitHub release
run: |
cd /tmp/build/android
bundle exec fastlane github branch:${{ steps.extract_branch.outputs.branch }} is_draft:${{ github.event.inputs.is_draft }}
env:
GH_ACCESS_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
working-directory: android
16 changes: 8 additions & 8 deletions .github/workflows/create_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
name: "Deploy to Stores and create GitHub release"
runs-on: ubuntu-latest
steps:


- name: Extract branch name
shell: bash
Expand All @@ -38,13 +37,14 @@ jobs:

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

- name: Clone flutter repository
uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.3'
channel: stable
- run: flutter doctor -v
fetch-depth: 0
submodules: recursive

- name: Set FLUTTER_ROOT environment variable
run: echo "FLUTTER_ROOT=$(pwd)/flutter/bin" >> $GITHUB_ENV

- run: $FLUTTER_ROOT/flutter doctor -v

- name: Setup signing config
uses: ./.github/actions/setup-android-signing-config
Expand All @@ -57,7 +57,7 @@ jobs:

- name: Get packages and run codegen
run: |
bash install_dependencies.sh
bash install_dependencies_with_submodule.sh
bash update_changelogs.sh
working-directory: scripts

Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/release-deploy-play-store.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ jobs:

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

- name: Clone flutter repository
uses: subosito/flutter-action@v2
with:
flutter-version: '3.13.3'
channel: stable
- run: flutter doctor -v
fetch-depth: 0
submodules: recursive

- name: Set FLUTTER_ROOT environment variable
run: echo "FLUTTER_ROOT=$(pwd)/flutter/bin" >> $GITHUB_ENV

- run: $FLUTTER_ROOT/flutter doctor -v

- name: Setup signing config
uses: ./.github/actions/setup-android-signing-config
Expand All @@ -51,7 +52,7 @@ jobs:

- name: Get packages and run codegen
run: |
bash install_dependencies.sh
bash install_dependencies_with_submodule.sh
bash update_changelogs.sh
working-directory: scripts

Expand Down
1 change: 0 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[submodule "flutter"]
path = flutter
url = https://github.com/flutter/flutter
branch = stable
13 changes: 12 additions & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,16 @@ dependencies {
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
// Required for flutter_local_notifications
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'

}

ext.abiCodes = ["x86_64": 1, "armeabi-v7a": 2, "arm64-v8a": 3]
import com.android.build.OutputFile
android.applicationVariants.all { variant ->
variant.outputs.each { output ->
def abiName = output.getFilter(OutputFile.ABI)
def abiVersionCode = project.ext.abiCodes.get(abiName)
if (abiVersionCode != null) {
output.versionCodeOverride = variant.versionCode * 10 + abiVersionCode
}
}
}
4 changes: 2 additions & 2 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.7.0'
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath 'com.android.tools.build:gradle:7.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// implementation 'androidx.window:window:1.0.0'
// implementation 'androidx.window:window-java:1.0.0'
Expand Down
6 changes: 3 additions & 3 deletions android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ platform :android do |options|
lane :publish_in_play_store do |options|
release_status = (options[:is_draft] ? "draft" : "completed")
track = (options[:track])
sh "flutter build appbundle -v"
sh "$FLUTTER_ROOT/flutter build appbundle -v"
upload_to_play_store(
track: track,
release_status: release_status,
Expand All @@ -47,8 +47,8 @@ platform :android do |options|

desc "Builds apks and creates a new release on GitHub"
lane :github do |options|
sh "flutter build apk --split-per-abi --release"
sh "flutter build apk --release"
sh "$FLUTTER_ROOT/flutter build apk --split-per-abi --release"
sh "$FLUTTER_ROOT/flutter build apk --release"
set_github_release(
repository_name: "astubenbord/paperless-mobile",
api_token: ENV["GH_ACCESS_TOKEN"],
Expand Down
1 change: 1 addition & 0 deletions android/fastlane/metadata/android/de-DE/changelogs/55.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Hinzufügen von Build-Skript für F-Droid
1 change: 1 addition & 0 deletions android/fastlane/metadata/android/de-DE/changelogs/56.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* F-Droid build
1 change: 1 addition & 0 deletions android/fastlane/metadata/android/en-US/changelogs/55.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Add build script for F-Droid
1 change: 1 addition & 0 deletions android/fastlane/metadata/android/en-US/changelogs/56.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* F-Droid build
3 changes: 1 addition & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Jun 23 08:50:38 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
16 changes: 0 additions & 16 deletions assets/images/bmc-logo.svg

This file was deleted.

Binary file removed assets/images/documents_headache.png
Binary file not shown.
Loading