diff --git a/.github/workflows/linux-build.yml b/.github/workflows/linux-build.yml new file mode 100644 index 000000000..a57e65849 --- /dev/null +++ b/.github/workflows/linux-build.yml @@ -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? onContentCommitted` in custom_cupertino_text_field.dart + # and insert `//` before it to comment it out. + sed -i "s|final ValueChanged? 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/action-gh-release@v0.1.14 + with: + files: bluebubbles-linux-x64.zip \ No newline at end of file diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml new file mode 100644 index 000000000..2b0e31311 --- /dev/null +++ b/.github/workflows/windows-build.yml @@ -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? onContentCommitted` in custom_cupertino_text_field.dart + # and insert `//` before it to comment it out. + sed -i "s|final ValueChanged? 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/action-gh-release@v0.1.14 + with: + files: bluebubbles-windows-x64.zip \ No newline at end of file diff --git a/windows/exe-installer.iss b/windows/exe-installer.iss new file mode 100644 index 000000000..b8e61934f --- /dev/null +++ b/windows/exe-installer.iss @@ -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 \ No newline at end of file