Skip to content
Merged
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
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI Tests

on:
pull_request:

jobs:
backend-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: apps/backend
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: package-lock.json

- name: Install dependencies
working-directory: .
run: npm ci

- name: Run unit tests
run: npm run test:unit

- name: Run integration tests
run: npm run test:integration

flutter-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: subosito/flutter-action@v2
with:
flutter-version: '3.41.9'
channel: stable
cache: true

- name: Get dependencies
working-directory: apps/flutter
run: flutter pub get

- name: Run widget tests
working-directory: apps/flutter
run: flutter test
75 changes: 75 additions & 0 deletions .github/workflows/flutter-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Flutter Release APK

on:
push:
branches:
- release/development

permissions:
contents: write

jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: '17'

- uses: subosito/flutter-action@v2
with:
flutter-version: '3.41.9'
channel: stable
cache: true

- name: Inject google-services.json
run: echo '${{ secrets.GOOGLE_SERVICES_JSON }}' > apps/flutter/android/app/google-services.json

- name: Decode and write release keystore
run: |
echo '${{ secrets.KEYSTORE_BASE64 }}' | base64 --decode > apps/flutter/android/app/universe-release.jks
cat > apps/flutter/android/key.properties <<EOF
storeFile=../app/universe-release.jks
storePassword=${{ secrets.KEYSTORE_PASSWORD }}
keyAlias=${{ secrets.KEY_ALIAS }}
keyPassword=${{ secrets.KEY_PASSWORD }}
EOF

- name: Get dependencies
working-directory: apps/flutter
run: flutter pub get

- name: Build release APK
working-directory: apps/flutter
run: |
flutter build apk --release \
--dart-define=API_BASE_URL=${{ secrets.RAILWAY_BACKEND_URL }} \
--dart-define=FIREBASE_API_KEY=${{ secrets.FIREBASE_API_KEY_ANDROID }} \
--dart-define=FIREBASE_APP_ID=${{ secrets.FIREBASE_APP_ID_ANDROID }}

- name: Get next version tag
id: tag
run: |
LATEST=$(git tag --list 'v*' --sort=-version:refname | head -n1)
if [ -z "$LATEST" ]; then
NEXT="v1.0.0"
else
NEXT=$(echo $LATEST | awk -F. '{printf "%s.%s.%d", $1, $2, $3+1}')
fi
echo "tag=$NEXT" >> $GITHUB_OUTPUT

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.tag }}
name: "Release ${{ steps.tag.outputs.tag }}"
body: |
Release APK — built from `release/development`
Commit: ${{ github.sha }}
files: apps/flutter/build/app/outputs/flutter-apk/app-release.apk
token: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading