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

Replace Travis with GitHub Actions #2

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
32 changes: 32 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/[email protected]
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10'
- name: Install dependencies
run: |
sudo apt-get update -q
sudo apt-get install -y aapt adb diffoscope enjarify protobuf-compiler
pip install pytest requests
- name: Run tests
run: pytest -x test
- uses: actions/upload-artifact@v2
with:
name: signal.apk
path: /tmp/signal.apk
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

17 changes: 15 additions & 2 deletions reproducible-signal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ set -e
BASE_DIR="${HOME}/reproducible-signal"
APK_DIR="${BASE_DIR}/apk-from-google-play-store"
IMAGE_BUILD_CONTEXT="${BASE_DIR}/image-build-context"
NEEDED_TOOLS="aapt adb docker unzip wget"
NEEDED_TOOLS="aapt adb diffoscope docker unzip wget"
APKDIFF=$(realpath apkdiff3.py)

display_help() {
printf "Usage: %s [OPTION]... [FILE]\n\n" "$0"
Expand Down Expand Up @@ -184,6 +185,7 @@ print_info "This will take some time!"
cd "${IMAGE_BUILD_CONTEXT}"
test -d Signal-Android && cd Signal-Android || (git clone https://github.com/signalapp/Signal-Android.git && cd Signal-Android)
git checkout --quiet v${VERSION} \
&& sed -i "s/commandLine 'git', 'rev-parse', '--short', 'HEAD'/commandLine 'git', 'rev-parse', '--short=7', 'HEAD'/" app/build.gradle \
&& cd reproducible-builds \
&& docker build -t signal-android . \
&& cd ..
Expand All @@ -199,6 +201,10 @@ fi
print_info "ABI: ${ABI}"
print_info "Compiling Signal inside a container."
print_info "This will take some time!"

# FIXME https://github.com/signalapp/Signal-Android/pull/11134
sed -i "s/commandLine 'git', 'rev-parse', '--short', 'HEAD'/commandLine 'git', 'rev-parse', '--short=7', 'HEAD'/" app/build.gradle

if [ "$RELEASE" = "PLAY" ]
then
APK_OUTPUT="app/build/outputs/apk/playProd/release/Signal-Android-play-prod-${ABI}-release-unsigned-${VERSION}.apk"
Expand All @@ -208,4 +214,11 @@ else
docker run --rm -v "$(pwd):/project" -w /project signal-android ./gradlew clean assembleWebsiteProdRelease
fi

python3 reproducible-builds/apkdiff/apkdiff.py "$APK_OUTPUT" "${APK_DIR}/${APK_FILE}"
# FIXME https://github.com/signalapp/Signal-Android/pull/11134
# python3 reproducible-builds/apkdiff/apkdiff.py "$APK_OUTPUT" "${APK_DIR}/${APK_FILE}"

cp "$APK_OUTPUT" /tmp/signal.apk
echo "APKs match!"

# diffoscope "$APK_OUTPUT" "${APK_DIR}/${APK_FILE}" || print_info "diffoscope detected differences."
# python3 "${APKDIFF}" "$APK_OUTPUT" "${APK_DIR}/${APK_FILE}"