Initial commit
This commit is contained in:
229
.github/workflows/integrate.yaml
vendored
Normal file
229
.github/workflows/integrate.yaml
vendored
Normal file
@@ -0,0 +1,229 @@
|
||||
name: Pull Request Workflow
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
merge_group:
|
||||
|
||||
jobs:
|
||||
code_tests:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: webiny/action-conventional-commits@v1.4.2
|
||||
- name: Check licenses
|
||||
uses: fsfe/reuse-action@v6
|
||||
- run: ./scripts/generate-locale-config.sh
|
||||
- run: git diff --exit-code
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version-file: .tool_versions.yaml
|
||||
cache: true
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: Check for empty translations
|
||||
run: |
|
||||
if grep -rn '": ""' lib/l10n/*.arb; then
|
||||
echo "❌ Found empty translation strings."
|
||||
exit 1
|
||||
fi
|
||||
- run: flutter pub get
|
||||
- name: Check if pubspec.lock is up to date
|
||||
run: git diff --exit-code pubspec.lock
|
||||
- name: Check formatting
|
||||
run: dart format lib/ test/ --set-exit-if-changed
|
||||
- name: Check license compliance
|
||||
run: dart run license_checker check-licenses -c licenses.yaml --problematic
|
||||
- name: Check for unused translations
|
||||
run: |
|
||||
dart pub global activate sweeper
|
||||
dart pub global run sweeper check
|
||||
- run: flutter analyze
|
||||
- name: Search unused dependencies
|
||||
run: |
|
||||
dart pub global activate dependency_validator
|
||||
dart pub global run dependency_validator
|
||||
- run: dart run dart_code_linter:metrics analyze lib --reporter=github
|
||||
- run: dart run dart_code_linter:metrics check-unused-code lib
|
||||
- run: dart run dart_code_linter:metrics check-unused-files lib
|
||||
- run: dart run dart_code_linter:metrics check-unused-l10n lib
|
||||
- name: Check for commented-out Dart code with semicolons
|
||||
run: |
|
||||
if grep -R --include="*.dart" -nE '^[[:space:]]*//[^/<].*;[[:space:]]*$' lib/; then
|
||||
echo ""
|
||||
echo "❌ Found commented-out Dart code ending with semicolon."
|
||||
exit 1
|
||||
fi
|
||||
- name: Add Firebase Messaging
|
||||
run: ./scripts/add-firebase-messaging.sh
|
||||
- run: flutter analyze
|
||||
- run: flutter test
|
||||
|
||||
build_debug_apk:
|
||||
needs: [ code_tests ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: ./.github/actions/free_up_space
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version-file: .tool_versions.yaml
|
||||
cache: true
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: Cache Gradle
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: gradle-${{ runner.os }}-
|
||||
- run: ./scripts/add-firebase-messaging.sh
|
||||
- run: flutter build apk --debug --target-platform android-x64
|
||||
- name: Upload Debug APK
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: debug-apk-x64
|
||||
path: build/app/outputs/flutter-apk/app-debug.apk
|
||||
|
||||
build_debug_web:
|
||||
needs: [ code_tests ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version-file: .tool_versions.yaml
|
||||
cache: true
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
|
||||
- run: flutter pub get
|
||||
- name: Prepare web
|
||||
run: ./scripts/prepare-web.sh
|
||||
- run: git diff --exit-code
|
||||
- run: flutter build web
|
||||
- name: Upload Web Build
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: Web Build
|
||||
path: build/web
|
||||
|
||||
build_debug_linux:
|
||||
needs: [ code_tests ]
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [ x64, arm64 ]
|
||||
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest'}}
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install git wget curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 libssl-dev libwebkit2gtk-4.1-dev libpulse-dev -y
|
||||
- run: echo "FLUTTER_VERSION=$(yq '.environment.flutter' < .tool_versions.yaml)" >> $GITHUB_ENV
|
||||
- name: Install Flutter
|
||||
run: |
|
||||
git clone --branch ${{ env.FLUTTER_VERSION }} https://github.com/flutter/flutter.git
|
||||
./flutter/bin/flutter doctor
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: ./flutter/bin/flutter pub get
|
||||
- run: ./flutter/bin/flutter build linux --target-platform linux-${{ matrix.arch }}
|
||||
|
||||
build_debug_ios:
|
||||
needs: [ code_tests ]
|
||||
runs-on: macos-15
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version-file: .tool_versions.yaml
|
||||
cache: true
|
||||
- name: Use specific XCode version
|
||||
run: sudo xcode-select --switch /Applications/Xcode_26.3.app
|
||||
- run: brew install sqlcipher
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: ./scripts/add-firebase-messaging.sh
|
||||
- run: flutter pub get
|
||||
- run: flutter build ios --no-codesign
|
||||
|
||||
integration_test:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 60
|
||||
needs: [ code_tests ]
|
||||
strategy:
|
||||
matrix:
|
||||
api-level: [34]
|
||||
env:
|
||||
ANDROID_USER_HOME: /home/runner/.android
|
||||
ANDROID_EMULATOR_HOME: /home/runner/.android
|
||||
ANDROID_AVD_HOME: /home/runner/.android/avd
|
||||
AVD_CONFIG_PATH: "~/.android/avd/test.avd/config.ini"
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: ./.github/actions/free_up_space
|
||||
# https://github.blog/changelog/2023-02-23-hardware-accelerated-android-virtualization-on-actions-windows-and-linux-larger-hosted-runners/
|
||||
- name: Enable KVM group perms
|
||||
run: |
|
||||
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
|
||||
sudo udevadm control --reload-rules
|
||||
sudo udevadm trigger --name-match=kvm
|
||||
- name: AVD cache
|
||||
uses: actions/cache@v6
|
||||
id: avd-cache
|
||||
with:
|
||||
path: ~/.android/*
|
||||
key: avd-${{ matrix.api-level }}-integration_docker
|
||||
- name: create AVD and generate snapshot for caching
|
||||
if: steps.avd-cache.outputs.cache-hit != 'true'
|
||||
uses: reactivecircus/android-emulator-runner@d94c3fbe4fe6a29e4a5ba47c12fb47677c73656b
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
target: google_apis
|
||||
arch: x86_64
|
||||
cores: 4
|
||||
ndk: 28.2.13676358
|
||||
force-avd-creation: false
|
||||
disk-size: 4096M
|
||||
ram-size: 4096M
|
||||
sdcard-path-or-size: 4096M
|
||||
emulator-options: -no-window -wipe-data -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||
script: |
|
||||
cat ${{ env.AVD_CONFIG_PATH }}
|
||||
|
||||
sed -i.bak 's/hw.lcd.density = .*/hw.lcd.density=420/' ${{ env.AVD_CONFIG_PATH }}
|
||||
sed -i.bak 's/hw.lcd.height = .*/hw.lcd.height=1920/' ${{ env.AVD_CONFIG_PATH }}
|
||||
sed -i.bak 's/hw.lcd.width = .*/hw.lcd.width=1080/' ${{ env.AVD_CONFIG_PATH }}
|
||||
|
||||
if ! grep -q "hw.lcd.density" ${{ env.AVD_CONFIG_PATH }} && echo "hw.lcd.density = 420" >> ${{ env.AVD_CONFIG_PATH }}; then :; fi
|
||||
if ! grep -q "hw.lcd.height" ${{ env.AVD_CONFIG_PATH }} && echo "hw.lcd.height = 1920" >> ${{ env.AVD_CONFIG_PATH }}; then :; fi
|
||||
if ! grep -q "hw.lcd.width" ${{ env.AVD_CONFIG_PATH }} && echo "hw.lcd.width = 1080" >> ${{ env.AVD_CONFIG_PATH }}; then :; fi
|
||||
|
||||
echo "Emulator settings (${{ env.AVD_CONFIG_PATH }})"
|
||||
cat ${{ env.AVD_CONFIG_PATH }}
|
||||
echo "Generated AVD snapshot for caching."
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version-file: .tool_versions.yaml
|
||||
cache: true
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: Cache Gradle
|
||||
uses: actions/cache@v6
|
||||
with:
|
||||
path: |
|
||||
~/.gradle/caches
|
||||
~/.gradle/wrapper
|
||||
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||
restore-keys: gradle-${{ runner.os }}-
|
||||
- name: Prepare Homeserver
|
||||
run: ./scripts/prepare_integration_test.sh
|
||||
- name: Integration tests
|
||||
id: integration_tests
|
||||
uses: reactivecircus/android-emulator-runner@v2
|
||||
with:
|
||||
api-level: ${{ matrix.api-level }}
|
||||
target: google_apis
|
||||
arch: x86_64
|
||||
cores: 16
|
||||
ndk: 28.2.13676358
|
||||
force-avd-creation: false
|
||||
disk-size: 4096M
|
||||
ram-size: 4096M
|
||||
sdcard-path-or-size: 4096M
|
||||
emulator-options: -no-snapshot-save -no-window -wipe-data -accel on -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
|
||||
script: flutter test integration_test/mobile_test.dart
|
||||
83
.github/workflows/main_deploy.yaml
vendored
Normal file
83
.github/workflows/main_deploy.yaml
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
name: Main Deploy Workflow
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: main_deploy
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
deploy_web:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version-file: .tool_versions.yaml
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
|
||||
- name: Prepare web
|
||||
run: ./scripts/prepare-web.sh
|
||||
- run: rm ./assets/vodozemac/.gitignore
|
||||
- run: flutter pub get
|
||||
- name: Build Release Web
|
||||
run: flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --release --source-maps --base-href "/nightly/"
|
||||
- run: mv build/web/ public
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }}
|
||||
publish_dir: ./public
|
||||
publish_branch: gh-pages
|
||||
destination_dir: nightly
|
||||
|
||||
deploy_playstore_internal:
|
||||
runs-on: ubuntu-latest
|
||||
concurrency:
|
||||
group: deploy_playstore
|
||||
queue: max
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version-file: .tool_versions.yaml
|
||||
cache: true
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '3.3'
|
||||
- uses: ./.github/actions/free_up_space
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: Install Fastlane
|
||||
run: gem install fastlane -NV
|
||||
- name: Add Firebase Messaging
|
||||
run: |
|
||||
echo '${{secrets.GOOGLE_SERVICES_JSON}}' | base64 -d > android/app/google-services.json
|
||||
./scripts/add-firebase-messaging.sh
|
||||
- run: flutter pub get
|
||||
- name: Prepare Android Release Build
|
||||
env:
|
||||
FDROID_KEY: ${{ secrets.FDROID_KEY }}
|
||||
FDROID_KEY_PASS: ${{ secrets.FDROID_KEY_PASS }}
|
||||
PLAYSTORE_DEPLOY_KEY: ${{ secrets.PLAYSTORE_DEPLOY_KEY }}
|
||||
run: ./scripts/prepare-android-release.sh
|
||||
- name: Remove Android Auto metadata for Play Store
|
||||
run: sed -i '/Android Auto/,/automotive_app_desc/d' android/app/src/main/AndroidManifest.xml
|
||||
- name: Build Android Release
|
||||
run: flutter build appbundle --target-platform android-arm,android-arm64
|
||||
- name: Set changelog
|
||||
working-directory: android/fastlane/metadata/android/en-US/changelogs
|
||||
run: git log --no-merges -1 --pretty=%B > default.txt
|
||||
- name: Deploy Android Release
|
||||
run: |
|
||||
mkdir -p build/android
|
||||
cp build/app/outputs/bundle/release/app-release.aab build/android/
|
||||
cd android
|
||||
bundle install
|
||||
bundle update fastlane
|
||||
bundle exec fastlane deploy_internal_test
|
||||
cd ..
|
||||
60
.github/workflows/matrix_notify.yaml
vendored
Normal file
60
.github/workflows/matrix_notify.yaml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Matrix Notification
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
|
||||
jobs:
|
||||
notify:
|
||||
if: ${{ (github.event_name == 'issues' && github.event.issue.user.login != 'krille-chan') || (github.event_name == 'pull_request_target' && github.event.pull_request.user.login != 'krille-chan') }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Send notification to Matrix room
|
||||
env:
|
||||
HOMESERVER: ${{ secrets.MATRIX_HOMESERVER }}
|
||||
ACCESS_TOKEN: ${{ secrets.MATRIX_ACCESS_TOKEN }}
|
||||
ROOM_ID: ${{ secrets.MATRIX_ROOM_ID }}
|
||||
EVENT_NAME: ${{ github.event_name }}
|
||||
ISSUE_TITLE: ${{ github.event.issue.title }}
|
||||
ISSUE_URL: ${{ github.event.issue.html_url }}
|
||||
ISSUE_LABELS: ${{ join(github.event.issue.labels.*.name, ', ') }}
|
||||
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
PR_URL: ${{ github.event.pull_request.html_url }}
|
||||
PR_LABELS: ${{ join(github.event.pull_request.labels.*.name, ', ') }}
|
||||
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
|
||||
run: |
|
||||
if [ "${EVENT_NAME}" = "issues" ]; then
|
||||
EMOJI="📝"
|
||||
PREFIX="New Issue"
|
||||
TITLE="${ISSUE_TITLE}"
|
||||
URL="${ISSUE_URL}"
|
||||
LABELS="${ISSUE_LABELS}"
|
||||
AUTHOR="${ISSUE_AUTHOR}"
|
||||
else
|
||||
EMOJI="🔀"
|
||||
PREFIX="New Pull Request"
|
||||
TITLE="${PR_TITLE}"
|
||||
URL="${PR_URL}"
|
||||
LABELS="${PR_LABELS}"
|
||||
AUTHOR="${PR_AUTHOR}"
|
||||
fi
|
||||
|
||||
AUTHOR_URL="https://github.com/${AUTHOR}"
|
||||
PLAIN="${EMOJI} ${PREFIX} by ${AUTHOR}: ${TITLE} - ${URL}"
|
||||
HTML="<h3>${EMOJI} ${PREFIX}</h3>"
|
||||
HTML="${HTML}<b><a href='${URL}'>${TITLE}</a></b><br/>"
|
||||
HTML="${HTML}👤 <a href='${AUTHOR_URL}'>${AUTHOR}</a>"
|
||||
if [ -n "${LABELS}" ]; then
|
||||
HTML="${HTML}<br/>🏷️ ${LABELS}"
|
||||
fi
|
||||
TXN_ID=$(date +%s%N)
|
||||
|
||||
curl -s -o /dev/null -w "%{http_code}" -X PUT \
|
||||
"${HOMESERVER}/_matrix/client/v3/rooms/${ROOM_ID}/send/m.room.message/${TXN_ID}" \
|
||||
-H "Authorization: Bearer ${ACCESS_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "$(jq -n --arg body "$PLAIN" --arg html "$HTML" \
|
||||
'{"msgtype":"m.notice","body":$body,"format":"org.matrix.custom.html","formatted_body":$html}')"
|
||||
216
.github/workflows/release.yaml
vendored
Normal file
216
.github/workflows/release.yaml
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
name: Release Workflow
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
concurrency:
|
||||
group: release_workflow
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build_web:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version-file: .tool_versions.yaml
|
||||
cache: true
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
|
||||
- run: flutter pub get
|
||||
- name: Prepare web
|
||||
run: ./scripts/prepare-web.sh
|
||||
- run: rm ./assets/vodozemac/.gitignore
|
||||
- name: Build Release Web
|
||||
run: flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --release --source-maps --base-href "/web/"
|
||||
- name: Create archive
|
||||
run: tar -czf tatuchat-web.tar.gz build/web/
|
||||
- name: Upload Web Build
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: Web Build
|
||||
path: tatuchat-web.tar.gz
|
||||
- name: Upload to release
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: tatuchat-web.tar.gz
|
||||
asset_name: tatuchat-web.tar.gz
|
||||
asset_content_type: application/gzip
|
||||
- name: Clone fluffychat website
|
||||
run: |
|
||||
git clone https://github.com/krille-chan/fluffychat-website.git
|
||||
cat CHANGELOG.md >> fluffychat-website/src/changelog.md
|
||||
cat PRIVACY.md >> fluffychat-website/src/privacy.md
|
||||
- name: Build website
|
||||
working-directory: fluffychat-website
|
||||
run: |
|
||||
npm ci
|
||||
npm run build
|
||||
mv out ../public
|
||||
- name: Copy TatuChat web into it
|
||||
run: |
|
||||
mkdir public/web
|
||||
mkdir public/nightly
|
||||
cp -r build/web/* public/web/
|
||||
cp -r build/web/* public/nightly/
|
||||
echo "tatuchat.im" >> public/CNAME
|
||||
- name: Deploy to GitHub Pages
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }}
|
||||
publish_dir: ./public
|
||||
publish_branch: gh-pages
|
||||
cname: tatuchat.im
|
||||
|
||||
build_apk:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version-file: .tool_versions.yaml
|
||||
cache: true
|
||||
- name: Add Firebase Messaging
|
||||
run: |
|
||||
echo '${{secrets.GOOGLE_SERVICES_JSON}}' | base64 -d > android/app/google-services.json
|
||||
./scripts/add-firebase-messaging.sh
|
||||
- uses: ./.github/actions/free_up_space
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: flutter pub get
|
||||
- name: Prepare Android Release Build
|
||||
env:
|
||||
FDROID_KEY: ${{ secrets.FDROID_KEY }}
|
||||
FDROID_KEY_PASS: ${{ secrets.FDROID_KEY_PASS }}
|
||||
PLAYSTORE_DEPLOY_KEY: ${{ secrets.PLAYSTORE_DEPLOY_KEY }}
|
||||
run: ./scripts/prepare-android-release.sh
|
||||
- run: flutter build apk --release --target-platform android-arm,android-arm64
|
||||
- name: Upload to release
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: build/app/outputs/apk/release/app-release.apk
|
||||
asset_name: tatuchat.apk
|
||||
asset_content_type: application/vnd.android.package-archive
|
||||
|
||||
build_linux:
|
||||
strategy:
|
||||
matrix:
|
||||
arch: [ x64, arm64 ]
|
||||
runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest'}}
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Install dependencies
|
||||
run: sudo apt-get update && sudo apt-get install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 libssl-dev libwebkit2gtk-4.1-dev -y
|
||||
- run: echo "FLUTTER_VERSION=$(yq '.environment.flutter' < .tool_versions.yaml)" >> $GITHUB_ENV
|
||||
- name: Install Flutter
|
||||
run: |
|
||||
git clone --branch ${{ env.FLUTTER_VERSION }} https://github.com/flutter/flutter.git
|
||||
./flutter/bin/flutter doctor
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- run: ./flutter/bin/flutter pub get
|
||||
- run: ./flutter/bin/flutter build linux --target-platform linux-${{ matrix.arch }}
|
||||
- name: Create archive
|
||||
run: tar -czf tatuchat-linux-${{ matrix.arch }}.tar.gz -C build/linux/${{ matrix.arch }}/release/bundle/ .
|
||||
- name: Upload to release
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ github.event.release.upload_url }}
|
||||
asset_path: tatuchat-linux-${{ matrix.arch }}.tar.gz
|
||||
asset_name: tatuchat-linux-${{ matrix.arch }}.tar.gz
|
||||
asset_content_type: application/gzip
|
||||
|
||||
deploy_playstore:
|
||||
runs-on: ubuntu-latest
|
||||
concurrency:
|
||||
group: deploy_playstore
|
||||
queue: max
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- uses: subosito/flutter-action@v2
|
||||
with:
|
||||
flutter-version-file: .tool_versions.yaml
|
||||
cache: true
|
||||
- name: Set up Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '3.3'
|
||||
- uses: ./.github/actions/free_up_space
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: Install Fastlane
|
||||
working-directory: android
|
||||
run: gem install fastlane -NV
|
||||
- name: Add Firebase Messaging
|
||||
run: |
|
||||
echo '${{secrets.GOOGLE_SERVICES_JSON}}' | base64 -d > android/app/google-services.json
|
||||
./scripts/add-firebase-messaging.sh
|
||||
- run: flutter pub get
|
||||
- name: Prepare Android Release Build
|
||||
env:
|
||||
FDROID_KEY: ${{ secrets.FDROID_KEY }}
|
||||
FDROID_KEY_PASS: ${{ secrets.FDROID_KEY_PASS }}
|
||||
PLAYSTORE_DEPLOY_KEY: ${{ secrets.PLAYSTORE_DEPLOY_KEY }}
|
||||
run: ./scripts/prepare-android-release.sh
|
||||
# Because of https://ko-fi.com/post/Why-TatuChat-is-no-longer-available-on-Android-A-A4E426QCYI
|
||||
- name: Remove Android Auto metadata for Play Store
|
||||
run: sed -i '/Android Auto/,/automotive_app_desc/d' android/app/src/main/AndroidManifest.xml
|
||||
- name: Build Android Release
|
||||
run: flutter build appbundle --target-platform android-arm,android-arm64
|
||||
- name: Get Tag Name
|
||||
id: tag_name
|
||||
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})"
|
||||
- name: Deploy Android Release
|
||||
run: |
|
||||
mkdir -p build/android
|
||||
cp build/app/outputs/bundle/release/app-release.aab build/android/
|
||||
cd android
|
||||
bundle install
|
||||
bundle update fastlane
|
||||
bundle exec fastlane deploy_internal_test
|
||||
if [[ $GITHUB_REF_NAME == rc* ]]; then
|
||||
bundle exec fastlane deploy_candidate
|
||||
else
|
||||
bundle exec fastlane deploy_release
|
||||
fi
|
||||
cd ..
|
||||
|
||||
deploy_docker:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v7
|
||||
- name: Log in to the Container registry
|
||||
uses: docker/login-action@v4.6.0
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v6
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
21
.github/workflows/stale.yaml
vendored
Normal file
21
.github/workflows/stale.yaml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: 'Close stale issues and PRs'
|
||||
on:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
|
||||
jobs:
|
||||
stale:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@v11
|
||||
with:
|
||||
stale-issue-message: 'This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 30 days.'
|
||||
stale-pr-message: 'This PR is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 30 days.'
|
||||
close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity.'
|
||||
close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity.'
|
||||
days-before-issue-stale: 365
|
||||
days-before-pr-stale: 365
|
||||
days-before-issue-close: 30
|
||||
days-before-pr-close: 30
|
||||
exempt-all-assignees: true
|
||||
operations-per-run: 1000
|
||||
Reference in New Issue
Block a user