2023-11-16 15:35:00 +01:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
2023-11-16 17:07:19 +01:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-11-18 23:33:33 +01:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- main
|
2023-11-16 15:35:00 +01:00
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
2023-11-17 15:25:41 +01:00
|
|
|
test:
|
|
|
|
name: Run Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Flutter
|
|
|
|
uses: subosito/flutter-action@v2
|
|
|
|
with:
|
|
|
|
channel: 'stable'
|
|
|
|
flutter-version: '3.x'
|
|
|
|
- name: Get dependencies
|
|
|
|
run: flutter pub get
|
|
|
|
- name: Analyze
|
|
|
|
run: flutter analyze
|
|
|
|
- name: Run tests
|
|
|
|
run: flutter test
|
|
|
|
|
2023-11-16 15:35:00 +01:00
|
|
|
build-linux:
|
|
|
|
name: Build for Linux
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-11-16 16:12:20 +01:00
|
|
|
- uses: actions/checkout@v4
|
2023-11-16 15:59:37 +01:00
|
|
|
- uses: subosito/flutter-action@v2
|
2023-11-16 15:35:00 +01:00
|
|
|
with:
|
2023-11-16 15:40:52 +01:00
|
|
|
channel: 'stable'
|
|
|
|
flutter-version: '3.x'
|
2023-11-16 15:59:37 +01:00
|
|
|
- run: |
|
|
|
|
sudo apt-get update -y
|
|
|
|
sudo apt-get install -y ninja-build libgtk-3-dev
|
2023-11-16 15:35:00 +01:00
|
|
|
- run: flutter config --enable-linux-desktop
|
|
|
|
- run: flutter pub get
|
2023-11-16 15:59:37 +01:00
|
|
|
- run: flutter build linux
|
2023-11-16 15:35:00 +01:00
|
|
|
- name: Archive Linux Artifact
|
|
|
|
uses: actions/upload-artifact@master
|
|
|
|
with:
|
|
|
|
name: linux-build
|
2023-11-16 16:16:09 +01:00
|
|
|
path: build/linux/x64/release/bundle
|
2023-11-16 15:35:00 +01:00
|
|
|
|
|
|
|
build-android:
|
|
|
|
name: Build for Android
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-11-16 16:12:20 +01:00
|
|
|
- uses: actions/checkout@v4
|
2023-11-16 15:59:37 +01:00
|
|
|
- uses: subosito/flutter-action@v2
|
2023-11-16 15:35:00 +01:00
|
|
|
with:
|
2023-11-16 15:40:52 +01:00
|
|
|
channel: 'stable'
|
|
|
|
flutter-version: '3.x'
|
2023-11-16 16:25:01 +01:00
|
|
|
- uses: actions/setup-java@v3
|
2023-11-16 15:35:00 +01:00
|
|
|
with:
|
|
|
|
distribution: 'zulu'
|
|
|
|
java-version: '11'
|
|
|
|
- run: flutter config --enable-android
|
|
|
|
- run: flutter pub get
|
|
|
|
- run: flutter build apk
|
|
|
|
- run: flutter build appbundle
|
|
|
|
- name: Archive Android Artifact
|
|
|
|
uses: actions/upload-artifact@master
|
|
|
|
with:
|
|
|
|
name: android-build
|
|
|
|
path: |
|
|
|
|
build/app/outputs/flutter-apk/app-release.apk
|
|
|
|
build/app/outputs/bundle/release/app-release.aab
|
|
|
|
|
2023-11-17 15:25:41 +01:00
|
|
|
build-web:
|
|
|
|
name: Build for Web
|
2023-11-16 15:35:00 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-11-16 16:12:20 +01:00
|
|
|
- uses: actions/checkout@v4
|
2023-11-16 15:59:37 +01:00
|
|
|
- uses: subosito/flutter-action@v2
|
2023-11-16 15:35:00 +01:00
|
|
|
with:
|
2023-11-16 15:40:52 +01:00
|
|
|
channel: 'stable'
|
|
|
|
flutter-version: '3.x'
|
2023-11-16 15:59:37 +01:00
|
|
|
- run: flutter config --enable-web
|
|
|
|
- run: flutter pub get
|
2023-11-16 16:12:20 +01:00
|
|
|
- run: flutter build web --base-href "/release_schedule/"
|
2023-11-17 15:25:41 +01:00
|
|
|
- name: Archive Web Artifact
|
2023-11-17 15:53:46 +01:00
|
|
|
uses: actions/upload-pages-artifact@v2
|
2023-11-17 15:25:41 +01:00
|
|
|
with:
|
|
|
|
name: web-build
|
|
|
|
path: build/web
|
|
|
|
|
|
|
|
deploy-web:
|
|
|
|
name: Deploy Web to GitHub Pages
|
|
|
|
|
|
|
|
concurrency:
|
|
|
|
group: "pages"
|
|
|
|
cancel-in-progress: false
|
|
|
|
|
|
|
|
needs:
|
|
|
|
- test
|
|
|
|
- build-web
|
|
|
|
|
2023-11-18 23:33:33 +01:00
|
|
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
|
|
|
2023-11-17 15:25:41 +01:00
|
|
|
permissions:
|
|
|
|
pages: write
|
|
|
|
id-token: write
|
|
|
|
|
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v2
|
2023-11-16 15:35:00 +01:00
|
|
|
with:
|
2023-11-17 15:25:41 +01:00
|
|
|
artifact_name: web-build
|