Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CICD: Create Auto-Build Workflows using GitHub Actions #1942

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
65 changes: 65 additions & 0 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# This workflow was built using the build instructions found at
# https://docs.bluebubbles.app/client/build-yourself-contribution-guide
name: Linux Build
on:
push:
tags:
- "v*"

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Install Additional Required Packages
run: |
sudo apt update
sudo apt-get install -y clang \
cmake \
ninja-build \
pkg-config \
libgtk-3-dev \
liblzma-dev \
gir1.2-appindicator3-0.1 \
libappindicator3-1 \
libappindicator3-dev \
libnotify-dev
- name: Comment Out ContentCommit issues
run: |
# Find `onContentCommitted` in blue_bubbles_text_field.dart
# and insert `//` at the beginning of the line to comment it out.
sed -i -e 's|^.*onContentCommitted.*|// &|' ./lib/layouts/conversation_view/text_field/blue_bubbles_text_field.dart
# The same thing in custom_cupertino_text_field.dart
sed -i -e 's|^.*onContentCommitted.*|// &|' ./lib/layouts/widgets/custom_cupertino_text_field.dart
# Find `final ValueChanged<CommittedContent>? onContentCommitted` in custom_cupertino_text_field.dart
# and insert `//` before it to comment it out.
sed -i "s|final ValueChanged<CommittedContent>? onContentCommitted.*|//&|g" ./lib/layouts/widgets/custom_cupertino_text_field.dart
# Find `void onContentCommit(CommittedContent content) async {` in blue_bubbles_text_field.dart
# and replace it with `void onContentCommit(dynamic content) async {`
sed -i "s|void onContentCommit(CommittedContent content) async {|void onContentCommit(dynamic content) async {|g" ./lib/layouts/conversation_view/text_field/blue_bubbles_text_field.dart
- name: Create .env File
run: touch ./.env

- name: Build
run: |
flutter config --enable-linux-desktop
flutter build linux
- name: Zip binaries
uses: papeloto/action-zip@v1
with:
files: build/linux/x64/release/bundle
dest: bluebubbles-linux-x64.zip
recursive: false

- name: Upload Artifacts
uses: softprops/[email protected]
with:
files: bluebubbles-linux-x64.zip
66 changes: 66 additions & 0 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# This workflow was built using the build instructions found at
# https://docs.bluebubbles.app/client/build-yourself-contribution-guide
name: Windows Build
on:
push:
tags:
- "v*"

jobs:
flutter-build:
runs-on: windows-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Comment Out ContentCommit issues
run: |
# Find `onContentCommitted` in blue_bubbles_text_field.dart
# and insert `//` at the beginning of the line to comment it out.
sed -i -e 's|^.*onContentCommitted.*|// &|' ./lib/layouts/conversation_view/text_field/blue_bubbles_text_field.dart
# The same thing in custom_cupertino_text_field.dart
sed -i -e 's|^.*onContentCommitted.*|// &|' ./lib/layouts/widgets/custom_cupertino_text_field.dart
# Find `final ValueChanged<CommittedContent>? onContentCommitted` in custom_cupertino_text_field.dart
# and insert `//` before it to comment it out.
sed -i "s|final ValueChanged<CommittedContent>? onContentCommitted.*|//&|g" ./lib/layouts/widgets/custom_cupertino_text_field.dart
# Find `void onContentCommit(CommittedContent content) async {` in blue_bubbles_text_field.dart
# and replace it with `void onContentCommit(dynamic content) async {`
sed -i "s|void onContentCommit(CommittedContent content) async {|void onContentCommit(dynamic content) async {|g" ./lib/layouts/conversation_view/text_field/blue_bubbles_text_field.dart
shell: bash

- name: Create .env File
run: touch \.env
shell: bash

- name: Build
run: |
flutter build windows
# TODO - Figure out how to pass this as an artifact to the next step.

build-exe-installer:
needs: flutter-build
runs-on: windows-latest
steps:
- name: Install InnoSetup
run: choco install innosetup

- name: Create EXE Installer
run: |
# TODO - Run inno setup, passing it windows/exe-installer.iss

- name: Zip EXE Installer
uses: papeloto/action-zip@v1
with:
files: build\windows\runner\Release\ dist\bluebubbles_installer_windows_x64.exe
dest: bluebubbles-installer-windows-x64.zip
recursive: false

- name: Upload EXE Installer
uses: softprops/[email protected]
with:
files: bluebubbles-windows-x64.zip
52 changes: 52 additions & 0 deletions windows/exe-installer.iss
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "BlueBubbles"
#define MyAppVersion "[version]"
#define MyAppPublisher "BlueBubbles"
#define MyAppURL "https://bluebubbles.app/"
#define MyAppExeName "bluebubbles_app.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{redacted}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=\dist\
OutputBaseFilename=bluebubbles_installer_windows_x64
SetupIconFile=\assets\icon\icon.ico
Compression=lzma
SolidCompression=yes
WizardStyle=modern

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
Source: "\build\windows\runner\Release\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
Source: "\build\windows\runner\Release\*.lib"; DestDir: "{app}"; Flags: ignoreversion
Source: "\build\windows\runner\Release\*.exp"; DestDir: "{app}"; Flags: ignoreversion
Source: "\build\windows\runner\Release\*.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "\build\windows\runner\Release\data\*"; DestDir: "{app}\data"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent