1010 # https://github.com/android-actions/setup-android?tab=readme-ov-file#sdk-version-selection
1111 CMDLINE_TOOLS_VERSION : 10406996 # 11.0
1212
13- # Pin build path for reproducible builds.
14- BUILD_PATH : /tmp/build
15- PUB_CACHE : /tmp/.pub-cache
16-
1713permissions :
1814 contents : write
1915
@@ -26,18 +22,10 @@ jobs:
2622 steps :
2723 - name : Checkout 🛎️
2824 uses : actions/checkout@v4
29- with :
30- path : repository
31-
32- - name : Move to /tmp directory
33- run : mv repository "$BUILD_PATH"
3425
3526 - name : Disable rustup auto-self-update
3627 run : rustup set auto-self-update disable
3728
38- - name : Setup rust cache
39- uses : Swatinem/rust-cache@v2
40-
4129 - name : Setup JDK
4230 uses : actions/setup-java@v4
4331 with :
@@ -53,42 +41,19 @@ jobs:
5341 - name : Access Android SDK build-tools
5442 run : echo "$ANDROID_HOME/build-tools"/*/ | awk -F' ' '{ print $1 }' >> $GITHUB_PATH
5543
56- # Cache the directory
57- - name : Cache directory
58- uses : actions/cache@v3
59- with :
60- path : ${{ env.BUILD_PATH }}/app/build
61- # Define a key for the cache, commonly includes the hash of dependencies
62- key : ${{ runner.os }}-app-build-${{ hashFiles('**/pubspec.yaml') }}
63- # Define a restore key if an exact match is not found
64- restore-keys : |
65- ${{ runner.os }}-app-build-
66-
6744 - name : Build APKs
68- working-directory : ${{ env.BUILD_PATH }}
6945 run : |
70- # Remove non-reproducable part of path strings.
71- SEP=$(echo -e "\x1f")
72- export CARGO_ENCODED_RUSTFLAGS="--remap-path-prefix=${HOME}/.cargo=/cargo/"
73- if [ ! -z "$CARGO_HOME" ]; then
74- export CARGO_ENCODED_RUSTFLAGS="$CARGO_ENCODED_RUSTFLAGS${SEP}--remap-path-prefix=${CARGO_HOME}=/cargo/"
75- fi
76-
77- export SOURCE_DATE_EPOCH=1
78- export ZERO_AR_DATE=1
79-
80- cd app
81- ./flutter build apk --release --split-per-abi
82- ./flutter build apk --release
46+ # Use the same build dir, this speeds up the build process
47+ export REUSE_BUILD=1
48+ ./scripts/reproducible apk --release --split-per-abi
49+ ./scripts/reproducible apk --release
8350
8451 - name : Archive mappings
85- working-directory : ${{ env.BUILD_PATH }}
8652 run : |
87- mv app/build/app/outputs /mapping/{release,mapping}
88- tar -czvf mapping.tar.gz --directory=app/build/app/outputs /mapping mapping
53+ mv app/build/reproducible /mapping/{release,mapping}
54+ tar -czvf mapping.tar.gz --directory=app/build/reproducible /mapping mapping
8955
9056 - name : Sign APKs
91- working-directory : ${{ env.BUILD_PATH }}
9257 env :
9358 KEYSTORE : ${{ secrets.KEYSTORE }}
9459 KEYALIAS : ${{ secrets.KEYALIAS }}
@@ -105,52 +70,47 @@ jobs:
10570 --v1-signing-enabled true \
10671 --v2-signing-enabled true \
10772 --v3-signing-enabled true \
108- --out "${name}.apk" \
109- "app/build/app/outputs /flutter-apk/app-${name}.apk"
73+ --out "app- ${name}.apk" \
74+ "app/build/reproducible /flutter-apk/app-${name}.apk"
11075 done
11176 rm keystore.p12
11277
11378 - name : Upload Arifact armeabi-v7a
11479 uses : svenstaro/upload-release-action@v2
11580 with :
11681 repo_token : ${{ secrets.GITHUB_TOKEN }}
117- file : " ${{ env.BUILD_PATH }}/ armeabi-v7a-release.apk"
82+ file : " app- armeabi-v7a-release.apk"
11883 asset_name : stride-armeabi-v7a.apk
119- override : true
12084 tag : ${{ github.ref }}
12185
12286 - name : Upload Arifact arm64-v8a
12387 uses : svenstaro/upload-release-action@v2
12488 with :
12589 repo_token : ${{ secrets.GITHUB_TOKEN }}
126- file : " ${{ env.BUILD_PATH }}/ arm64-v8a-release.apk"
90+ file : " app- arm64-v8a-release.apk"
12791 asset_name : stride-arm64-v8a.apk
128- override : true
12992 tag : ${{ github.ref }}
13093
13194 - name : Upload Arifact x86_64
13295 uses : svenstaro/upload-release-action@v2
13396 with :
13497 repo_token : ${{ secrets.GITHUB_TOKEN }}
135- file : " ${{ env.BUILD_PATH }}/ x86_64-release.apk"
98+ file : " app- x86_64-release.apk"
13699 asset_name : stride-x86_64.apk
137- override : true
138100 tag : ${{ github.ref }}
139101
140102 - name : Upload Arifact Universal
141103 uses : svenstaro/upload-release-action@v2
142104 with :
143105 repo_token : ${{ secrets.GITHUB_TOKEN }}
144- file : " ${{ env.BUILD_PATH }}/ release.apk"
106+ file : " app- release.apk"
145107 asset_name : stride.apk
146- override : true
147108 tag : ${{ github.ref }}
148109
149110 - name : Upload Arifact Mapping
150111 uses : svenstaro/upload-release-action@v2
151112 with :
152113 repo_token : ${{ secrets.GITHUB_TOKEN }}
153- file : " ${{ env.BUILD_PATH }}/ mapping.tar.gz"
114+ file : " mapping.tar.gz"
154115 asset_name : mapping.tar.gz
155- override : true
156116 tag : ${{ github.ref }}
0 commit comments