Skip to content

fix(legal_modal): make AlertDialog scrollable #35

fix(legal_modal): make AlertDialog scrollable

fix(legal_modal): make AlertDialog scrollable #35

Workflow file for this run

name: Compile and release production build
on:
push:
branches:
- main
pull_request_target:
types:
- closed
workflow_dispatch:
jobs:
get-version:
name: Extract Version from pubspec.yaml
runs-on: ubuntu-latest
if: (github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'release-v')) || github.event_name == 'workflow_dispatch'
outputs:
VERSION_NAME: ${{ steps.extract_version.outputs.VERSION_NAME }}
VERSION_NUMBER: ${{ steps.extract_version.outputs.VERSION_NUMBER }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Extract version from pubspec.yaml
id: extract_version
run: |
VERSION_FULL=$(grep '^version:' pubspec.yaml | sed 's/version: //')
VERSION_NAME=$(echo $VERSION_FULL | cut -d '+' -f 1)
VERSION_NUMBER=$(echo $VERSION_FULL | cut -d '+' -f 2)
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
echo "VERSION_NUMBER=$VERSION_NUMBER" >> $GITHUB_ENV
echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_OUTPUT
echo "VERSION_NUMBER=$VERSION_NUMBER" >> $GITHUB_OUTPUT
echo "Extracted Version Name: $VERSION_NAME"
echo "Extracted Version Number: $VERSION_NUMBER"
build-android:
name: Build Android .apk and .aab
runs-on: ubuntu-latest
needs: get-version
env:
ANDROID_AAB_RELEASE_PATH: build/app/outputs/bundle/release
ANDROID_APK_RELEASE_PATH: build/app/outputs/apk/release
VERSION_NAME: ${{ needs.get-version.outputs.VERSION_NAME }}
VERSION_NUMBER: ${{ needs.get-version.outputs.VERSION_NUMBER }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Decode android/app/keystore.jks
run: echo "${{ secrets.KEYSTORE_JKS }}" | base64 --decode > android/app/keystore.jks
- name: Decode android/key.properties
run: echo "${{ secrets.KEY_PROPERTIES }}" | base64 --decode > android/key.properties
- name: Decode .env
run: echo "${{ secrets.ENV }}" | base64 --decode > .env
- name: Setup Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- run: flutter clean
- run: flutter pub get
- name: Build apk
run: flutter build apk --release
- name: Build aab
run: flutter build appbundle --release
- name: Rename apk
run: mv $ANDROID_APK_RELEASE_PATH/app-release.apk PiHoleClient_${{ env.VERSION_NAME }}_Android.apk
- name: Rename aab
run: mv $ANDROID_AAB_RELEASE_PATH/app-release.aab PiHoleClient_${{ env.VERSION_NAME }}_Android.aab
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: android
path: |
PiHoleClient_${{ env.VERSION_NAME }}_Android.apk
PiHoleClient_${{ env.VERSION_NAME }}_Android.aab
build-linux:
name: Build Linux .tar.gz and .deb
runs-on: ubuntu-latest
needs: get-version
env:
LINUX_RELEASE_PATH: build/linux/x64/release/bundle
DEBIAN_RELEASE_PATH: build/linux/x64/release/debian
VERSION_NAME: ${{ needs.get-version.outputs.VERSION_NAME }}
VERSION_NUMBER: ${{ needs.get-version.outputs.VERSION_NUMBER }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Decode .env
run: echo "${{ secrets.ENV }}" | base64 --decode > .env
- name: Update version in debian.yaml
run: sed -i 's/<REPLACE_VERSION_NUMBER_ACTIONS>/${{ env.VERSION_NAME }}/g' debian/debian.yaml
- name: Update dependencies list
run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libcurl4-openssl-dev libsecret-1-dev libjsoncpp-dev
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- run: flutter clean
- run: flutter pub get
- name: Build linux
run: flutter build linux --release
- name: Install flutter_to_debian
run: dart pub global activate flutter_to_debian
- name: Generate .deb package
run: flutter_to_debian
- name: Move .deb package to project root
run: mv ${{ env.DEBIAN_RELEASE_PATH }}/PiHoleClient_${{ env.VERSION_NAME }}_amd64.deb PiHoleClient_${{ env.VERSION_NAME }}_Linux_amd64.deb
- name: Generate .tar.gz package
run: |
tar -czf PiHoleClient_${{ env.VERSION_NAME }}_Linux.tar.gz -C $LINUX_RELEASE_PATH \
data \
lib \
pi-hole-client
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux
path: |
PiHoleClient_${{ env.VERSION_NAME }}_Linux_amd64.deb
PiHoleClient_${{ env.VERSION_NAME }}_Linux.tar.gz
build-windows:
name: Build Windows installer
runs-on: windows-latest
needs: get-version
env:
VERSION_NAME: ${{ needs.get-version.outputs.VERSION_NAME }}
VERSION_NUMBER: ${{ needs.get-version.outputs.VERSION_NUMBER }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Decode .env
shell: pwsh
run: |
[IO.File]::WriteAllBytes('.env', [Convert]::FromBase64String('${{ secrets.ENV }}'))
- name: Update version in innosetup config file
shell: pwsh
run: |
(Get-Content windows/innosetup_installer_builder.iss) -replace '<REPLACE_VERSION_ACTIONS>', '${{ env.VERSION_NAME }}' | Out-File -encoding ASCII windows/innosetup_installer_builder.iss
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
cache: true
- run: flutter clean
- run: flutter pub get
- name: Build windows
run: flutter build windows --release
- name: Build installer witn innosetup
run: iscc /Q windows/innosetup_installer_builder.iss
- name: Rename installer
shell: pwsh
run: Move-Item -Path build/windows/PiHoleClient.exe -Destination build/windows/PiHoleClient_${{ env.VERSION_NAME }}_Windows_x64.exe
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows
path: build/windows/PiHoleClient_${{ env.VERSION_NAME }}_Windows_x64.exe
release-builds-github:
name: Release builds to GitHub
runs-on: ubuntu-latest
needs: [get-version, build-android, build-linux, build-windows]
env:
VERSION_NAME: ${{ needs.get-version.outputs.VERSION_NAME }}
VERSION_NUMBER: ${{ needs.get-version.outputs.VERSION_NUMBER }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create builds directory
run: mkdir releases
- name: Download Android artifacts
uses: actions/download-artifact@v4
with:
name: android
path: releases/
- name: Download Linux artifacts
uses: actions/download-artifact@v4
with:
name: linux
path: releases/
- name: Download Windows artifacts
uses: actions/download-artifact@v4
with:
name: windows
path: releases/
- name: Extract latest release notes from CHANGELOG.md
run: |
awk '/^## / {if (p) exit; p=1} p' CHANGELOG.md > latest_changelog.md
cat latest_changelog.md
- name: Release to GitHub
uses: ncipollo/release-action@v1
with:
artifacts: "releases/*"
token: ${{ secrets.GITHUB_TOKEN }}
tag: '${{ env.VERSION_NAME }}_(${{ env.VERSION_NUMBER }})'
name: v${{ env.VERSION_NAME }}
draft: true
prerelease: false
commit: ${{ github.sha }}
bodyFile: "latest_changelog.md"
release-build-google-play:
name: Release Android build to the Google Play Store
runs-on: ubuntu-latest
needs: [get-version, build-android, build-linux, build-windows]
permissions:
contents: read
id-token: write
env:
VERSION_NAME: ${{ needs.get-version.outputs.VERSION_NAME }}
VERSION_NUMBER: ${{ needs.get-version.outputs.VERSION_NUMBER }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download Android artifacts
uses: actions/download-artifact@v4
with:
name: android
- id: auth
uses: google-github-actions/auth@v2
with:
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Release app to Google Play
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJson: ${{ steps.auth.outputs.credentials_file_path }}
packageName: io.github.tsutsu3.pi_hole_client
releaseFiles: PiHoleClient_${{ env.VERSION_NAME }}_Android.aab
track: production # Available tracks are: production,beta,alpha,internal,test
status: draft
releaseName: ${{ env.VERSION_NAME }}