Merge pull request #115 from prateekmedia:fix-error #406
Workflow file for this run
This file contains 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: FlutterCI | |
on: | |
push: | |
tags: | |
- '*' | |
env: | |
FLUTTER_VERSION: "3.19.5" | |
jobs: | |
build-android-linux: | |
name: Android and Linux | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: "17.x" | |
- name: Setup flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
cache: true | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- name: Create artifacts directory | |
run: mkdir artifacts | |
- name: Generate android keystore | |
id: android_keystore | |
uses: timheuer/base64-to-file@v1.0.4 | |
with: | |
fileName: key.jks | |
encodedString: ${{ secrets.KEY_JKS }} | |
- name: Create key.properties | |
run: | | |
echo "storeFile=${{ steps.android_keystore.outputs.filePath }}" > android/key.properties | |
echo "storePassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties | |
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties | |
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties | |
- name: Build Flutter app | |
run: | | |
flutter build apk | |
mv build/app/outputs/apk/release/pstube-* artifacts/pstube-${{ github.ref_name }}-android.apk | |
- name: Install dependencies | |
run: sudo apt-get update -y && sudo apt-get install -y libfuse2 libmpv-dev ninja-build libgtk-3-dev dpkg-dev pkg-config rpm | |
# - name: Install appimagetool | |
# run: | | |
# wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" | |
# chmod +x appimagetool | |
# mv appimagetool /usr/local/bin/ | |
- name: Build desktop app | |
run: | | |
# Init Configuration for Linux Desktop | |
flutter config --enable-linux-desktop | |
dart pub global activate flutter_distributor | |
# Package to different formats | |
flutter_distributor package --platform=linux --targets=deb --skip-clean | |
flutter_distributor package --platform=linux --targets=rpm --skip-clean | |
# flutter_distributor package --platform=linux --targets=appimage --skip-clean | |
flutter_distributor package --platform=linux --targets=zip --skip-clean | |
# Move artifacts | |
mv dist/**/*-*-linux.deb artifacts/pstube-${{ github.ref_name }}-linux-x86_64.deb | |
mv dist/**/*-*-linux.rpm artifacts/pstube-${{ github.ref_name }}-linux-x86_64.rpm | |
# mv dist/**/*-*-linux.AppImage artifacts/pstube-${{ github.ref_name }}-linux-x86_64.AppImage | |
mv dist/**/*-*-linux.zip artifacts/pstube-${{ github.ref_name }}-linux-x86_64.zip | |
- name: Generate checksums | |
run: | | |
sha256sum artifacts/pstube-*-linux* > artifacts/sha256sum-linux | |
sha256sum artifacts/pstube-*-android* > artifacts/sha256sum-android | |
- name: Create a draft GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "artifacts/*" | |
draft: true | |
allowUpdates: true | |
updateOnlyUnreleased: true | |
build_windows: | |
name: Windows | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
cache: true | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- name: Create artifacts directory | |
run: mkdir artifacts | |
- name: Build Windows installer | |
run: | | |
# Init Configuration for Windows | |
flutter config --enable-windows-desktop | |
dart pub global activate flutter_distributor | |
make innoinstall | |
# Package to exe | |
flutter_distributor package --platform=windows --targets=exe --skip-clean | |
mv dist/**/pstube-*-windows-setup.exe artifacts/pstube-${{ github.ref_name }}-installer.exe | |
- name: Retain Windows EXE and DLLs | |
run: cp -r build/windows/x64/runner/Release pstube-${{ github.ref_name }}-windows | |
- name: Code sign Windows installer and EXE | |
uses: dlemstra/code-sign-action@v1 | |
with: | |
certificate: "${{ secrets.WINDOWS_CERTIFICATE }}" | |
password: "${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}" | |
files: | | |
artifacts/pstube-${{ github.ref_name }}-installer.exe | |
pstube-${{ github.ref_name }}-windows/pstube.exe | |
- name: Zip Windows EXE and DLLs | |
run: tar.exe -a -c -f artifacts/pstube-${{ github.ref_name }}-windows.zip pstube-${{ github.ref_name }}-windows | |
- name: Generate checksums | |
run: sha256sum artifacts/pstube-* > artifacts/sha256sum-windows | |
- name: Create a draft GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "artifacts/*" | |
draft: true | |
allowUpdates: true | |
updateOnlyUnreleased: true |