Skip to content

Bump flutter webview #155

Bump flutter webview

Bump flutter webview #155

Workflow file for this run

name: CI
on:
pull_request:
branches:
- "dev"
merge_group:
workflow_dispatch:
jobs:
app-changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
# For pull requests it's not necessary to checkout the code
- uses: dorny/paths-filter@v3
id: filter
with:
filters: |
src:
- ".github/workflows/violet-build.yml"
- "violet/**"
app-format:
needs: app-changes
if: ${{ needs.app-changes.outputs.src == 'true' }}
runs-on: ubuntu-latest
defaults:
run:
working-directory: violet
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- uses: actions/setup-java@v1
with:
java-version: "17.x"
- uses: subosito/flutter-action@v1
with:
channel: "stable"
flutter-version: 3.24.2
- uses: dtolnay/rust-toolchain@stable
- name: Formatting
run: dart format --output=none --set-exit-if-changed .
- name: Preprocess
run: |
cd lib/server
wget -q ${{ secrets.SECRET_SALT }} || echo 'String getValid(String vToken) { return vToken; }' > salt.dart
wget -q ${{ secrets.SECRET_WSALT }} || echo 'String getValid(String vToken) { return vToken; }' > wsalt.dart
- name: Analyze
run: flutter analyze --no-fatal-infos
app-ios-build:
runs-on: macos-latest
needs: [app-format, app-changes]
if: ${{ needs.app-changes.outputs.src == 'true' }}
defaults:
run:
working-directory: violet
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: 3.24.2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- uses: dtolnay/rust-toolchain@stable
- name: Preprocess
run: |
cd lib/server
wget -q ${{ secrets.SECRET_SALT }} || echo 'String getValid(String vToken) { return vToken; }' > salt.dart
wget -q ${{ secrets.SECRET_WSALT }} || echo 'String getValid(String vToken) { return vToken; }' > wsalt.dart
cd ../..
python3 preprocess-ios.py
- name: Podfile
run: |
cd ios
rm Podfile.lock
flutter clean
flutter pub get
pod install
pod update
cd ..
- name: Build
run: |
flutter build ios --release --no-codesign
mkdir -p Payload
mv ./build/ios/iphoneos/Runner.app Payload
zip -r -y Payload.zip Payload/Runner.app
mv Payload.zip Payload.ipa
- name: Upload IPA
uses: actions/upload-artifact@v4
with:
name: ipa-build
path: ./violet/Payload.ipa
app-android-build:
runs-on: ubuntu-latest
needs: [app-format, app-changes]
if: ${{ needs.app-changes.outputs.src == 'true' }}
defaults:
run:
working-directory: violet
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- uses: actions/setup-java@v1
with:
java-version: "17.x"
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: 3.24.2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- uses: dtolnay/rust-toolchain@stable
- name: Preprocess
run: |
cd lib/server
wget -q ${{ secrets.SECRET_SALT }} || echo 'String getValid(String vToken) { return vToken; }' > salt.dart
wget -q ${{ secrets.SECRET_WSALT }} || echo 'String getValid(String vToken) { return vToken; }' > wsalt.dart
cd ../..
python3 preprocess-android.py
- name: Build
run: |
flutter clean
flutter build apk --release
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: apk-build
path: ./violet/build/app/outputs/apk/release/app-release.apk
app-windows-build:
runs-on: windows-latest
needs: [app-format, app-changes]
if: ${{ needs.app-changes.outputs.src == 'true' }}
defaults:
run:
working-directory: violet
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha || github.event.merge_group.head_sha }}
- uses: actions/setup-java@v1
with:
java-version: "17.x"
- uses: subosito/flutter-action@v2
with:
channel: "stable"
flutter-version: 3.24.2
- uses: actions/setup-python@v2
with:
python-version: "3.8"
- uses: dtolnay/rust-toolchain@stable
- name: Preprocess
shell: powershell
run: |
cd lib/server
$secretSaltUrl = "${{ secrets.SECRET_SALT }}"
$secretWSaltUrl = "${{ secrets.SECRET_WSALT }}"
# Try downloading SECRET_SALT
try {
Invoke-WebRequest -Uri $secretSaltUrl -UseBasicParsing -OutFile "salt.dart"
} catch {
"String getValid(String vToken) { return vToken; }" | Out-File -Encoding "UTF8" -FilePath "salt.dart"
}
# Try downloading SECRET_WSALT
try {
Invoke-WebRequest -Uri $secretWSaltUrl -UseBasicParsing -OutFile "wsalt.dart"
} catch {
"String getValid(String vToken) { return vToken; }" | Out-File -Encoding "UTF8" -FilePath "wsalt.dart"
}
cd ../..
- name: Build
run: |
flutter clean
flutter build windows --release
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: windows-build
path: ./violet/build/windows/x64/runner/Release/