feat: In the settings menu, added app logo that will take you to a #143
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- "client/**" | |
- "scripts/**" | |
- ".github/workflows/main.yml" | |
- "package.json" | |
- "bun.lock" | |
jobs: | |
check_if_release_commit: | |
runs-on: self-hosted | |
outputs: | |
is_release: ${{ steps.check_tag.outputs.is_release }} | |
steps: | |
- name: Checkout code with tags | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetches all history and tags | |
- name: Check if commit is tagged for release (v*) | |
id: check_tag | |
run: | | |
# Check if any tag starting with 'v' points to the current commit HEAD | |
if git tag --points-at HEAD | grep -q "^v"; then | |
echo "Commit is tagged with a 'v*' tag. Build/test steps will be skipped in this workflow." | |
echo "is_release=true" >> $GITHUB_OUTPUT | |
else | |
echo "Commit is NOT tagged with a 'v*' tag. Build/test steps will proceed." | |
echo "is_release=false" >> $GITHUB_OUTPUT | |
fi | |
shell: bash | |
lint: | |
runs-on: self-hosted | |
needs: check_if_release_commit | |
if: needs.check_if_release_commit.outputs.is_release == 'false' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install signet app dependencies | |
run: nix develop .# --command bash -c "bun install ----frozen-lockfile" | |
- name: Lint code | |
run: nix develop .# --command bash -c "bun client lint" | |
- name: Typecheck code | |
run: nix develop .# --command bash -c "bun client typecheck" | |
android_build: | |
runs-on: self-hosted | |
needs: lint | |
outputs: | |
artifact_name: ${{ steps.rename_apk.outputs.artifact_name }} | |
apk_filename: ${{ steps.rename_apk.outputs.apk_filename }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# - name: Install Nix | |
# uses: DeterminateSystems/nix-installer-action@main | |
# - name: Enable Nix Magic Cache | |
# uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Install signet app dependencies | |
run: nix develop .# --command bash -c "bun install ----frozen-lockfile" | |
- name: Create sentry.properties | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
run: ./scripts/create_sentry_properties.sh | |
- name: Build signet Android app | |
run: nix develop .# --command bash -c "bun client build:android:ci" | |
- name: Rename APK with timestamp | |
id: rename_apk | |
run: | | |
apk_path="client/android/app/build/outputs/apk/signet/release/app-signet-release.apk" | |
timestamp=$(date +'%Y-%m-%d-%H-%M') | |
new_apk_name="noah-android-apk-${timestamp}" | |
apk_filename="${new_apk_name}.apk" | |
new_apk_path="client/android/app/build/outputs/apk/signet/release/${apk_filename}" | |
mv "${apk_path}" "${new_apk_path}" | |
echo "new_path=${new_apk_path}" >> $GITHUB_OUTPUT | |
echo "artifact_name=${new_apk_name}" >> $GITHUB_OUTPUT | |
echo "apk_filename=${apk_filename}" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Upload Android APK | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.rename_apk.outputs.artifact_name }} | |
path: ${{ steps.rename_apk.outputs.new_path }} | |
ios_build: | |
runs-on: macOS | |
needs: lint | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# - name: Install Nix | |
# uses: DeterminateSystems/nix-installer-action@main | |
# - name: Enable Nix Magic Cache | |
# uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Install signet app dependencies | |
run: nix develop .# --command bash -c "bun install ----frozen-lockfile && bun client ios:prebuild" | |
- name: Create sentry.properties | |
env: | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
run: ./scripts/create_sentry_properties.sh | |
- name: Build iOS signet app | |
run: nix develop .# --command bash -c "bun client build:ios:signet:release" | |
send_telegram_notification: | |
runs-on: ubuntu-latest | |
needs: android_build | |
if: success() | |
steps: | |
- name: Download APK artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ needs.android_build.outputs.artifact_name }} | |
- name: Start local Telegram Bot API server | |
run: | | |
docker run -d --name local-bot-api \ | |
-p 8081:8081 \ | |
-v ${{ github.workspace }}:/data \ | |
-e TELEGRAM_API_ID=${{ secrets.TELEGRAM_API_ID }} \ | |
-e TELEGRAM_API_HASH=${{ secrets.TELEGRAM_API_HASH }} \ | |
aiogram/telegram-bot-api:latest --local | |
- name: Wait for Bot API server to be ready | |
run: | | |
echo "Waiting 5 seconds for the local Bot API server to initialize..." | |
sleep 5 | |
- name: Send APK using local Bot API server | |
run: | | |
curl -s -X POST "http://localhost:8081/bot${{ secrets.TELEGRAM_TOKEN }}/sendDocument" \ | |
-F chat_id="${{ secrets.BLIXT_CHAT_ID }}" \ | |
-F message_thread_id="${{ secrets.BLIXT_TOPIC_ID }}" \ | |
-F document=@"${{ needs.android_build.outputs.apk_filename }}" \ | |
-F caption="New Noah build is available! | |
Commit: ${{ github.sha }} | |
Message: ${{ github.event.head_commit.message }}" | |
- name: Stop and remove local Bot API server | |
if: always() | |
run: | | |
echo "Stopping and removing the Docker container..." | |
docker stop local-bot-api | |
docker rm local-bot-api |