Merge pull request #1 from recoskyler/dev #1
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: "Build Flutter .apk, .deb, .rpm, and .exe, then create a new release" | |
on: | |
push: | |
tags: ['*'] | |
jobs: | |
build-and-release-rpm: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/setup-java@v1 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Cache Flutter dependencies | |
uses: actions/[email protected] | |
with: | |
path: /opt/hostedtoolcache/flutter | |
key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION }} | |
- uses: subosito/[email protected] | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- run: flutter doctor -v | |
- name: Install build dependencies | |
run: sudo apt-get update && sudo apt-get install -y rpm patchelf libgtk-3-0 libblkid1 liblzma5 clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio | |
- run: flutter clean | |
- run: flutter pub get | |
- name: Build release | |
run: flutter build linux --release | |
- name: Activate flutter_distributor | |
run: dart pub global activate flutter_distributor | |
- name: Build .rpm | |
run: flutter_distributor release --name=dev --jobs=release-dev-linux-rpm | |
- name: Create Release | |
uses: ncipollo/[email protected] | |
with: | |
artifacts: "dist/**/*.rpm" | |
- name: Upload a Build Artifact | |
uses: actions/[email protected] | |
with: | |
name: release-rpm | |
path: dist/ | |
build-and-release-deb: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/setup-java@v1 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Cache Flutter dependencies | |
uses: actions/[email protected] | |
with: | |
path: /opt/hostedtoolcache/flutter | |
key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION }} | |
- uses: subosito/[email protected] | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- run: flutter doctor -v | |
- name: Install build dependencies | |
run: sudo apt-get update && sudo apt-get install -y rpm patchelf libgtk-3-0 libblkid1 liblzma5 clang cmake git ninja-build pkg-config libgtk-3-dev liblzma-dev libstdc++-12-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio | |
- run: flutter clean | |
- run: flutter pub get | |
- name: Build release | |
run: flutter build linux --release | |
- name: Activate flutter_distributor | |
run: dart pub global activate flutter_distributor | |
- name: Build .deb | |
run: flutter_distributor release --name=dev --jobs=release-dev-linux-deb | |
- name: Create Release | |
uses: ncipollo/[email protected] | |
with: | |
artifacts: "dist/**/*.deb" | |
- name: Upload a Build Artifact | |
uses: actions/[email protected] | |
with: | |
name: release-deb | |
path: dist/ | |
build-and-release-apk: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/setup-java@v1 | |
with: | |
distribution: 'zulu' | |
java-version: ${{ env.JAVA_VERSION }} | |
- name: Cache Flutter dependencies | |
uses: actions/[email protected] | |
with: | |
path: /opt/hostedtoolcache/flutter | |
key: ${{ runner.OS }}-flutter-install-cache-${{ env.FLUTTER_VERSION }} | |
- uses: subosito/[email protected] | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- run: flutter doctor -v | |
- name: Create the Keystore | |
run: | | |
# import keystore from secrets | |
touch $RUNNER_TEMP/app.keystore | |
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/app/app.keystore | |
- name: Create the key.properties | |
run: | | |
touch android/key.properties | |
echo 'storePassword=${{ secrets.KEYSTORE_PASSWORD }}' >> android/key.properties | |
echo 'keyPassword=${{ secrets.KEYSTORE_PASSWORD }}' >> android/key.properties | |
echo 'keyAlias=${{ secrets.KEYSTORE_PASSWORD_ALIAS }}' >> android/key.properties | |
echo 'storeFile=app.keystore' >> android/key.properties | |
- run: flutter pub get | |
- run: flutter build apk --split-per-abi | |
- run: flutter build appbundle | |
- name: Create Release | |
uses: ncipollo/[email protected] | |
with: | |
artifacts: "build/app/outputs/apk/release/*.apk, build/app/outputs/bundle/release/*.aab" | |
- name: Upload a Build Artifact | |
uses: actions/[email protected] | |
with: | |
name: release-apk | |
path: build/app/outputs/apk/ | |
build-and-release-exe: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
- name: Install project dependencies | |
run: flutter pub get | |
- name: Generate intermediates | |
run: flutter pub run build_runner build --delete-conflicting-outputs | |
- name: Enable windows build | |
run: flutter config --enable-windows-desktop | |
- name: Build artifacts | |
run: flutter build windows --release | |
- name: Archive Release | |
uses: thedoctor0/zip-release@master | |
with: | |
type: 'zip' | |
filename: pomo-${{github.ref_name}}-windows.zip | |
directory: build/windows/runner/Release | |
- name: Create Release | |
uses: ncipollo/[email protected] | |
with: | |
artifacts: "build/windows/runner/Release/pomo-${{github.ref_name}}-windows.zip" | |
- name: Upload a Build Artifact | |
uses: actions/[email protected] | |
with: | |
name: release-exe | |
path: build/windows/runner/Release/ |