Skip to content

Commit

Permalink
merge latest
Browse files Browse the repository at this point in the history
  • Loading branch information
atavism committed Oct 27, 2024
1 parent 0d2f981 commit c181329
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 129 deletions.
121 changes: 1 addition & 120 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,27 +91,6 @@ jobs:
print(f'::set-output name=prefix::{li}')
print(f'::set-output name=version_file::{vf}')
build-linux:
uses: ./.github/workflows/build-linux.yml
secrets: inherit
needs: set-version
with:
version: ${{ needs.set-version.outputs.version }}
prefix: ${{ needs.set-version.outputs.prefix }}
dist-suffix: x64

# build-windows-x32:
# uses: ./.github/workflows/build-windows.yml
# secrets: inherit
# needs: set-version
# with:
# version: ${{ needs.set-version.outputs.version }}
# prefix: ${{ needs.set-version.outputs.prefix }}
# dist-suffix: 32-bit
# installer-suffix: -x32
# update-suffix: 386
# arch: x32

build-windows-x64:
uses: ./.github/workflows/build-windows.yml
secrets: inherit
Expand All @@ -125,104 +104,18 @@ jobs:
installer-suffix: -x64
arch: x64

build-darwin:
uses: ./.github/workflows/build-darwin.yml
secrets: inherit
needs: set-version
with:
macos_version: macos-14
xcode_version: latest-stable
version: ${{ needs.set-version.outputs.version }}
version_file: ${{ needs.set-version.outputs.version_file }}
prefix: ${{ needs.set-version.outputs.prefix }}

build-ios:
uses: ./.github/workflows/build-ios.yml
secrets: inherit
needs: set-version
with:
macos_version: macos-14
xcode_version: latest-stable
version: ${{ needs.set-version.outputs.version }}
version_file: ${{ needs.set-version.outputs.version_file }}
prefix: ${{ needs.set-version.outputs.prefix }}

build-android:
uses: ./.github/workflows/build-android.yml
secrets: inherit
needs: set-version
with:
version: ${{ needs.set-version.outputs.version }}
version_file: ${{ needs.set-version.outputs.version_file }}
prefix: ${{ needs.set-version.outputs.prefix }}

push-binaries:
runs-on: ubuntu-latest
needs: [ set-version, build-android, build-ios, build-darwin, build-linux, build-windows-x64 ]
needs: [ set-version, build-windows-x64 ]
env:
version: ${{ needs.set-version.outputs.version }}
prefix: ${{ needs.set-version.outputs.prefix }}
steps:
- name: Download the mac build output
uses: actions/download-artifact@v4
with:
name: osx-build
- name: Download the linux deb build output
uses: actions/download-artifact@v4
with:
name: linux-rpm-build
- name: Download the linux rpm build output
uses: actions/download-artifact@v4
with:
name: linux-deb-build

- name: Download the windows64 build output
uses: actions/download-artifact@v4
with:
name: windows64-installer-signed

- name: Download the apk build output
uses: actions/download-artifact@v4
with:
name: android-apk-build

- name: Download the aab build output
uses: actions/download-artifact@v4
with:
name: android-aab-build

- name: Download the IPA
uses: actions/download-artifact@v4
with:
name: Lantern.ipa

- name: Upload Lantern to TestFlight
uses: apple-actions/upload-testflight-build@v1
if: (needs.set-version.outputs.prefix == 'lantern-installer-preview'|| needs.set-version.outputs.prefix == 'lantern-installer') && (needs.determine-platform.outputs.platform == 'ios' || needs.determine-platform.outputs.platform == 'all')
with:
app-path: Lantern.ipa
issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}

- name: Upload Android App bundle to Play Store (beta)
if: needs.set-version.outputs.prefix == 'lantern-installer-preview' && (needs.determine-platform.outputs.platform == 'android' || needs.determine-platform.outputs.platform == 'all')
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: org.getlantern.lantern
releaseFiles: lantern-installer.aab
track: beta

- name: Upload Android App bundle to Play Store (production)
if: needs.set-version.outputs.prefix == 'lantern-installer' && (needs.determine-platform.outputs.platform == 'android' || needs.determine-platform.outputs.platform == 'all')
uses: r0adkll/upload-google-play@v1
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }}
packageName: org.getlantern.lantern
releaseFiles: lantern-installer.aab
track: production

- name: Grant private modules access
run: git config --global url."https://${{ secrets.CI_PRIVATE_REPOS_GH_TOKEN }}:[email protected]/".insteadOf "https://github.com/"

Expand All @@ -231,23 +124,11 @@ jobs:

- name: Rename builds
run: |
diff lantern-installer.apk ${{ env.prefix }}.apk || mv -f lantern-installer.apk ${{ env.prefix }}.apk
diff lantern-installer.aab ${{ env.prefix }}.aab || mv -f lantern-installer.aab ${{ env.prefix }}.aab
mv "lantern_${{env.version}}_x64.deb" ${{ env.prefix }}-64-bit.deb
mv "lantern_${{env.version}}_x64.rpm" ${{ env.prefix }}.rpm
mv -f lantern-installer.dmg ${{ env.prefix }}.dmg
diff lantern-installer-x64.exe ${{ env.prefix }}-64-bit.exe || mv -f lantern-installer-x64.exe ${{ env.prefix }}-64-bit.exe
mv -f Lantern.ipa ${{ env.prefix }}.ipa
- name: Prepare sha256 sums
run: |
shasum -a 256 ${{ env.prefix }}.apk | cut -d " " -f 1 > ${{ env.prefix }}.apk.sha256
shasum -a 256 ${{ env.prefix }}.aab | cut -d " " -f 1 > ${{ env.prefix }}.aab.sha256
shasum -a 256 ${{ env.prefix }}-mac.dmg | cut -d " " -f 1 > ${{ env.prefix }}-mac.dmg.sha256
shasum -a 256 ${{ env.prefix }}-mac_arm.dmg | cut -d " " -f 1 > ${{ env.prefix }}-mac_arm.dmg.sha256
shasum -a 256 ${{ env.prefix }}-x64.exe | cut -d " " -f 1 > ${{ env.prefix }}-x64.exe.sha256
shasum -a 256 ${{ env.prefix }}-64-bit.deb | cut -d " " -f 1 > ${{ env.prefix }}-64-bit.deb.sha256
shasum -a 256 ${{ env.prefix }}.ipa | cut -d " " -f 1 > ${{ env.prefix }}.ipa.sha256
- name: Commit
run: |
Expand Down
20 changes: 11 additions & 9 deletions lib/features/window/window_container.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ class _WindowContainerState extends State<WindowContainer> with WindowListener {
super.initState();
if (isDesktop()) {
windowManager.addListener(this);
_initializeWindow();
WidgetsBinding.instance.addPostFrameCallback((_) async {
await _initializeWindow();
await windowManager.setPreventClose(true);
await _setWindowResizable();
});
}
}

Future<void> _initializeWindow() async {
await windowManager.setPreventClose(true);
await _setWindowResizable();
await windowManager.show();
await windowManager.focus();
}
Expand All @@ -51,13 +51,15 @@ class _WindowContainerState extends State<WindowContainer> with WindowListener {
// after the window is resized.
// See https://github.com/leanflutter/window_manager/issues/464
// and https://github.com/KRTirtho/spotube/issues/1553
Future<void>.delayed(const Duration(milliseconds: 100), () async {
final size = await windowManager.getSize();
await windowManager.setSize(
Size(size.width + 1, size.height + 1),
);
await Future<void>.delayed(const Duration(milliseconds: 100), () async {
windowManager.getSize().then((Size value) {
windowManager
.setSize(
Size(value.width + 1, value.height + 1),
)
.then((_) => setState(() => {}));
});
await windowManager.setResizable(false);
setState(() => {});
});
}

Expand Down

0 comments on commit c181329

Please sign in to comment.