Skip to content

Updated templates. #188

Updated templates.

Updated templates. #188

Workflow file for this run

name: Build Installers
# 20241024 gjw Construct bundles for various distributions. The
# bundles (.zip or .exe or .dmg files) are created as artefacts that
# can be downloaded locally using the github command line `gh`. I am
# not utilising github SECRETS yet but will do so to push the packages
# directly to togaware.com and to build signed packages.
on:
push:
branches:
- dev
env:
APP: notepod
LINUX_PKGS: libsecret-1-dev
FLUTTER_VERSION: '3.35.3'
jobs:
########################################################################
# LINUX
#
# 20250110 gjw Originally I was building on Ubuntu 22.04 since my
# 24.04 version would not run on Mint 21.3. Then moved even older to
# Ubuntu 20.04 to get it more widely available. Seems to work on
# 22.04 and 24.04. Backwards the error was: "rattle:
# /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found
# (required by rattle)" On Ubuntu 20.04 the highest version of GLIBC
# is GLIBC2.30.
#
# 20250311 gjw Support for Ubuntu 20.04 is being deprecated
# https://github.com/gjwgit/rattleng/actions/runs/13753262146.
# Move to 22.04 to get broadest deployment.
package-linux-zip:
if: |
contains(github.event.head_commit.message, 'bump version') ||
contains(github.event.head_commit.message, 'build installers') ||
contains(github.event.head_commit.message, 'build linux')
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
- name: Install OS Dependencies
run: |
sudo apt-get update -y
printf '#%.0s' {1..72}; printf '\nninja-build\n'
sudo apt-get install -y ninja-build
printf '#%.0s' {1..72}; printf '\nlibgtk-3-dev\n'
sudo apt-get install -y libgtk-3-dev
printf '#%.0s' {1..72}; printf '\nclang cmake\n'
sudo apt-get install -y clang cmake
- name: Install extra Linux packages
if: env.LINUX_PKGS != ''
run: |
printf '#%.0s' {1..72}; printf '\n${{env.LINUX_PKGS}}\n'
sudo apt-get install -y ${{env.LINUX_PKGS}}
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
architecture: x64
flutter-version: ${{env.FLUTTER_VERSION}}
- name: Confirm Flutter Version
run: flutter --version
- name: Install Flutter Project Dependencies
run: flutter pub get
- name: Enable Linux Build
run: flutter config --enable-linux-desktop
- name: Build Flutter Linux app
run: flutter build linux --release
# Package as ZIP
- name: Zip Bundle
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: ${{ env.APP }}-${{ github.ref_name }}-linux.zip
directory: build/linux/x64/release/bundle
- name: Upload Artefact
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP }}-linux-zip
path: build/linux/x64/release/bundle/${{ env.APP }}-${{ github.ref_name }}-linux.zip
########################################################################
# MACOS
package-macos-dmg-zip:
if: |
contains(github.event.head_commit.message, 'bump version') ||
contains(github.event.head_commit.message, 'build installers') ||
contains(github.event.head_commit.message, 'build macos')
runs-on: macos-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{env.FLUTTER_VERSION}}
- name: Confirm Flutter Version
run: flutter --version
- name: Install Flutter Project Dependencies
run: flutter pub get
- name: Enable macOS desktop
run: flutter config --enable-macos-desktop
- name: Build Flutter macOS app
run: flutter build macos --release
- name: Note the build location
run: |
pwd
ls -lh build/macos/Build/Products/Release
# Package as DMG
- name: Create DMG (Unsigned)
run: |
mkdir -p dmg_temp
cp -R "build/macos/Build/Products/Release/${{ env.APP }}.app" dmg_temp/
ln -s /Applications dmg_temp/Applications
hdiutil create -volname "${{ env.APP }}" \
-srcfolder dmg_temp \
-ov -format UDZO \
"${{ env.APP }}-${{github.ref_name}}-macos-unsigned.dmg"
- name: Note the DMG created
run: |
ls -lh
- name: Upload Artefact
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP }}-macos-dmg
path: ${{ env.APP }}-${{github.ref_name}}-macos-unsigned.dmg
# Package as ZIP
- name: Create ZIP
uses: thedoctor0/zip-release@master
with:
type: 'zip'
directory: build/macos/Build/Products/Release
path: ${{ env.APP }}.app
filename: ${{ env.APP }}-${{github.ref_name}}-macos.zip
- name: Review ZIP exists
run: ls -lh build/macos/Build/Products/Release
- name: Upload Artefact
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP }}-macos-zip
path: build/macos/Build/Products/Release/${{ env.APP }}-${{github.ref_name}}-macos.zip
########################################################################
# WINDOWS
package-windows-zip-exe:
if: |
contains(github.event.head_commit.message, 'bump version') ||
contains(github.event.head_commit.message, 'build installers') ||
contains(github.event.head_commit.message, 'build windows')
runs-on: windows-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: x64
flutter-version: ${{env.FLUTTER_VERSION}}
- name: Confirm Flutter Version
run: flutter --version
- name: Install Flutter Project Dependencies
run: flutter pub get
- name: Enable Windows Desktop
run: flutter config --enable-windows-desktop
- name: Build Flutter Windows app
run: flutter build windows --release
# Package as ZIP
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: ${{ env.APP }}-${{github.ref_name}}-windows.zip
directory: build/windows/x64/runner/Release
- name: Upload Artefact
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP }}-windows-zip
path: build/windows/x64/runner/Release/${{ env.APP }}-${{github.ref_name}}-windows.zip
# Package as EXE
- name: Check the DLLs for Inclusion in the .iss script
run: dir D:\a\${{ env.APP }}\${{ env.APP }}\build\windows\x64\runner\Release\
- name: Get Version from pubspec.yaml
run: |
$version = (Get-Content pubspec.yaml | Select-String '^version:[^^]*' | ForEach-Object { $_.ToString().Split(":")[1].Trim().Split("+")[0].Trim() })
echo "APP_VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Compile .ISS to .EXE Installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.5
with:
path: installers/app-windows.iss
options: /O+
- name: Upload Artefact
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP }}-windows-inno
path: D:\a\${{ env.APP }}\${{ env.APP }}\installers\installers\${{ env.APP }}-dev-windows-inno.exe