Skip to content

Commit b35367c

Browse files
committed
Merge remote-tracking branch 'upstream/main' into feat-uninstall-button
2 parents f4fd5e8 + 22f37a3 commit b35367c

21 files changed

+657
-344
lines changed

.github/workflows/autobuild-main.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,32 @@ jobs:
1111
branch: main
1212

1313
release:
14-
runs-on: ubuntu-latest
14+
runs-on: ${{ matrix.runner }}
15+
strategy:
16+
matrix:
17+
include:
18+
- runner: ubuntu-latest
19+
arch: x86_64
20+
- runner: ubuntu-24.04-arm
21+
arch: arm
22+
1523
needs: build
1624
permissions:
1725
contents: write
1826
steps:
1927
- name: Download artifact from build job
2028
uses: actions/download-artifact@v4
2129
with:
22-
name: ${{ needs.build.outputs.bin_name }}
23-
- name: Run shell tasks
24-
run: |
25-
find -name oudedetai -type f -exec chmod +x {} \;
30+
name: oudedetai-${{ matrix.arch }}
31+
32+
- name: Make binary executable
33+
run: chmod +x oudedetai-${{ matrix.arch }}
34+
2635
- name: Upload release to test repo
2736
uses: softprops/action-gh-release@v1
2837
with:
2938
tag_name: main-latest
30-
# target_commitish: ${{ needs.build.outputs.sha }}
31-
body: ''
3239
prerelease: true
33-
files: ${{ needs.build.outputs.bin_name }}
40+
files: oudedetai-${{ matrix.arch }}
3441
repository: FaithLife-Community/test-builds
3542
token: ${{ secrets.N8MARTI_ACCESS_TOKEN }}
36-

.github/workflows/build-branch.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ on:
66
required: true
77
type: string
88
outputs:
9-
bin_name:
10-
description: "name of built binary"
11-
value: ${{ jobs.build.outputs.bin_name }}
9+
bin_name_x86_64:
10+
description: "name of x86_64 built binary"
11+
value: ${{ jobs.build.outputs.bin_name_x86_64 }}
12+
bin_name_arm:
13+
description: "name of ARM built binary"
14+
value: ${{ jobs.build.outputs.bin_name_arm }}
1215
sha:
1316
value: ${{ github.sha }}
1417
sha_short:
@@ -26,9 +29,17 @@ jobs:
2629
uses: ./.github/workflows/run-tests.yml
2730

2831
build:
29-
runs-on: ubuntu-20.04
32+
runs-on: ${{ matrix.runner }}
33+
strategy:
34+
matrix:
35+
include:
36+
- runner: ubuntu-latest
37+
arch: x86_64
38+
- runner: ubuntu-24.04-arm
39+
arch: arm
3040
outputs:
31-
bin_name: ${{ steps.pyinstaller.outputs.bin_name }}
41+
bin_name_x86_64: ${{ steps.pyinstaller.outputs.bin_name_x86_64 }}
42+
bin_name_arm: ${{ steps.pyinstaller.outputs.bin_name_arm }}
3243
sha_short: ${{ steps.sha.outputs.sha_short }}
3344
steps:
3445
- uses: actions/checkout@v4
@@ -57,12 +68,15 @@ jobs:
5768
- name: Build with pyinstaller
5869
id: pyinstaller
5970
run: |
60-
./scripts/build-binary.sh
61-
echo "bin_name=oudedetai" >> $GITHUB_OUTPUT
71+
ARCH=${{ matrix.arch }}
72+
./scripts/build-binary.sh $ARCH
73+
BIN_NAME="oudedetai-${ARCH}"
74+
echo "bin_name_${ARCH}=$BIN_NAME" >> $GITHUB_OUTPUT
75+
mv dist/oudedetai "dist/$BIN_NAME"
6276
6377
- name: Upload artifact
6478
uses: actions/upload-artifact@v4
6579
with:
66-
name: oudedetai
67-
path: dist/oudedetai
80+
name: ${{ steps.pyinstaller.outputs.bin_name_x86_64 || steps.pyinstaller.outputs.bin_name_arm }}
81+
path: dist/${{ steps.pyinstaller.outputs.bin_name_x86_64 || steps.pyinstaller.outputs.bin_name_arm }}
6882
compression-level: 0

.github/workflows/build-release.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,32 @@ jobs:
2121
branch: main
2222

2323
release:
24-
runs-on: ubuntu-latest
24+
runs-on: ${{ matrix.runner }}
25+
strategy:
26+
matrix:
27+
include:
28+
- runner: ubuntu-latest
29+
arch: x86_64
30+
- runner: ubuntu-24.04-arm
31+
arch: arm
2532
needs: build
2633
permissions:
2734
contents: write
2835
steps:
29-
- name: download
36+
- name: Download artifact from build job
3037
uses: actions/download-artifact@v4
3138
with:
32-
name: oudedetai
33-
- name: release
39+
name: oudedetai-${{ matrix.arch }}
40+
41+
- name: Make binary executable
42+
run: chmod +x oudedetai-${{ matrix.arch }}
43+
44+
- name: Upload release to GitHub
3445
uses: softprops/action-gh-release@v1
3546
env:
3647
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3748
with:
3849
tag_name: ${{ inputs.tag }}
3950
draft: true
4051
prerelease: ${{ inputs.prerelease }}
41-
files: ${{ needs.build.outputs.bin_name }}
52+
files: oudedetai-${{ matrix.arch }}

.github/workflows/build-snap.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Build snap
2+
on:
3+
workflow_dispatch: {}
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- uses: actions/checkout@v4
10+
- name: Install Dependencies
11+
run: |
12+
sudo apt install -y snapd
13+
sudo snap install --classic snapcraft
14+
# It would be ideal to add current user to the lxd group, but that's not easy in GHA
15+
sudo lxd init --auto
16+
sudo chmod -R o+r ${{github.workspace}}
17+
sudo chown -R :lxd ${{github.workspace}}
18+
- name: Patch snapcraft.yaml
19+
run: |
20+
echo We want to build from the current branch not re-pull from git.
21+
sed -i 's#source: https://github.com/FaithLife-Community/LogosLinuxInstaller.git#source: https://github.com/FaithLife-Community/LogosLinuxInstaller.git\n source-commit: ${{ github.sha }}#' snap/snapcraft.yaml
22+
sed -zi 's#override-pull: |\n craftctl default\n craftctl set version=$(git describe --tag)#override-pull: |\n craftctl default\n craftctl set version=dev-$(git rev-parse --short HEAD)#' snap/snapcraft.yaml
23+
- name: Debug information
24+
run: |
25+
sudo ls -al ${{github.workspace}}
26+
sudo ls -al ${{github.workspace}}/ou_dedetai/assets
27+
cat snap/snapcraft.yaml
28+
- name: Build snap
29+
working-directory: snap
30+
run: |
31+
sudo snapcraft || (echo "dumping failure log:";sudo bash -c 'cat /root/.local/state/snapcraft/log/*.log'; exit 1)
32+
ls -al
33+
- name: Upload snap
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: oudedetai-${{ github.sha }}.snap
37+
path: snap/*.snap

.github/workflows/build-test.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,31 @@ jobs:
1414
branch: ${{ inputs.branch }}
1515

1616
release:
17-
runs-on: ubuntu-latest
17+
runs-on: ${{ matrix.runner }}
18+
strategy:
19+
matrix:
20+
include:
21+
- runner: ubuntu-latest
22+
arch: x86_64
23+
- runner: ubuntu-24.04-arm
24+
arch: arm
1825
needs: build
1926
permissions:
2027
contents: write
2128
steps:
2229
- name: Download artifact from build job
2330
uses: actions/download-artifact@v4
2431
with:
25-
name: ${{ needs.build.outputs.bin_name }}
32+
name: oudedetai-${{ matrix.arch }}
33+
2634
- name: Fix file permissions
27-
run: |
28-
find -name oudedetai -type f
29-
find -name oudedetai -type f -exec chmod +x {} \;
35+
run: chmod +x oudedetai-${{ matrix.arch }}
36+
3037
- name: Upload release to test repo
3138
uses: softprops/action-gh-release@v1
3239
with:
3340
tag_name: ${{ inputs.branch }}-${{ needs.build.outputs.sha_short }}
3441
prerelease: true
35-
files: ${{ needs.build.outputs.bin_name }}
42+
files: oudedetai-${{ matrix.arch }}
3643
repository: FaithLife-Community/test-builds
3744
token: ${{ secrets.N8MARTI_ACCESS_TOKEN }}
38-

ou_dedetai/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ def approve_or_exit(self, question: str, context: Optional[str] = None) -> bool:
136136

137137
def approve(self, question: str, context: Optional[str] = None) -> bool:
138138
"""Asks the user a y/n question"""
139-
question = (f"{context}\n" if context else "") + question
139+
question = (f"{context}\n\n" if context else "") + question
140140
options = ["Yes", "No"]
141141
return self.ask(question, options) == "Yes"
142142

ou_dedetai/config.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,18 @@ def get_logos_appdata_dir(
490490
return f'{wine_prefix}/drive_c/users/{wine_user}/AppData/Local/{faithlife_product}'
491491

492492

493+
def get_logos_user_id(
494+
logos_appdata_dir: str
495+
) -> Optional[str]:
496+
logos_data_path = Path(logos_appdata_dir) / "Data"
497+
contents = os.listdir(logos_data_path)
498+
children = [logos_data_path / child for child in contents]
499+
file_children = [child for child in children if child.is_dir()]
500+
if file_children and len(file_children) > 0:
501+
return file_children[0].name
502+
else:
503+
return None
504+
493505
class Config:
494506
"""Set of configuration values.
495507
@@ -792,6 +804,14 @@ def _logos_appdata_dir(self) -> Optional[str]:
792804
self.faithlife_product
793805
)
794806

807+
@property
808+
def _logos_user_id(self) -> Optional[str]:
809+
"""Name of the Logos user id throughout the app"""
810+
logos_appdata_dir = self._logos_appdata_dir
811+
if logos_appdata_dir is None:
812+
return None
813+
return get_logos_user_id(logos_appdata_dir)
814+
795815
@property
796816
# This used to be called WINEPREFIX
797817
def wine_prefix(self) -> str:
@@ -814,7 +834,16 @@ def wine_binary(self) -> str:
814834
# Return the full path so we the callee doesn't need to think about it
815835
if self._raw.wine_binary is not None and not Path(self._raw.wine_binary).exists() and (Path(self.install_dir) / self._raw.wine_binary).exists(): # noqa: E501
816836
return str(Path(self.install_dir) / self._raw.wine_binary)
817-
if not Path(output).exists():
837+
# Output a warning if the path doesn't exist and isn't relative to
838+
# the install dir.
839+
# In the case of appimage, this won't exist for part of the
840+
# installation, but still is valid. And the appimage uses a relative
841+
# path or an absolute that's relative to the install dir
842+
if (
843+
not Path(output).exists()
844+
and Path(output).is_absolute()
845+
and not Path(output).is_relative_to(self.install_dir)
846+
):
818847
logging.warning(f"Wine binary {output} doesn't exist")
819848
return output
820849

ou_dedetai/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def get_runmode() -> str:
6161
else:
6262
CACHE_DIR = str(Path(os.getenv('XDG_CACHE_HOME', Path.home() / '.cache' / 'FaithLife-Community'))) #noqa: E501
6363

64-
DATA_HOME = str(Path(os.getenv('XDG_DATA_HOME', Path.home() / '.local/share') / 'FaithLife-Community')) #noqa: E501
64+
DATA_HOME = str(Path(os.getenv('XDG_DATA_HOME', str(Path.home() / '.local/share'))) / 'FaithLife-Community') #noqa: E501
6565
CONFIG_DIR = os.getenv("XDG_CONFIG_HOME", "~/.config") + "/FaithLife-Community"
6666
STATE_DIR = os.getenv("XDG_STATE_HOME", "~/.local/state") + "/FaithLife-Community"
6767

@@ -91,7 +91,7 @@ def get_runmode() -> str:
9191
FAITHLIFE_PRODUCTS = ["Logos", "Verbum"]
9292
FAITHLIFE_PRODUCT_VERSIONS = ["10"] # This used to include 9
9393

94-
SUPPORT_MESSAGE = f"If you need help, please consult:\n{WIKI_LINK}\nIf that doesn't answer your question, please use the \"Get Support\" option" # noqa: E501
94+
SUPPORT_MESSAGE = f"If you need help, please consult:\n{WIKI_LINK}\nIf the install failed, use the \"Get Support\" operation" # noqa: E501
9595
DEFAULT_SUPPORT_FILE_NAME = "FaithlifeCommunitySupport.zip"
9696

9797
# Strings for choosing a follow up file or directory

0 commit comments

Comments
 (0)