Skip to content

Commit

Permalink
ci: First step towards F-Droid (#3922)
Browse files Browse the repository at this point in the history
* ci: First step towards F-Droid

* + instead of -
  • Loading branch information
M123-dev authored May 6, 2023
1 parent 69858ba commit 623e306
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/internal-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
continue-on-error: true
with:
tag: "${{ env.NORMALIZED_TAG }}"
message: "Internal release: ${{ env.VERSION_NAME }}-${{ env.VERSION_CODE }}"
message: "Internal release: ${{ env.VERSION_NAME }}+${{ env.VERSION_CODE }}"
force_push_tag: true

- name: Set output
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ jobs:

- name: Version
run: echo "${{ env.VERSION_NAME }}+${{ env.VERSION_CODE }}"

# We need to add the VERSION_CODE to the release in order for F-Droid to have the same VERSION_CODE as the other Stores
- name: Update release tag description
uses: rickstaa/action-create-tag@v1
continue-on-error: true
with:
tag: "v${{ env.VERSION_NAME }}"
message: "Public release: ${{ env.VERSION_NAME }}+${{ env.VERSION_CODE }}"
force_push_tag: true

- name: Set output
id: set_output
Expand Down
7 changes: 7 additions & 0 deletions ci/rename_package_name_F-Droid.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
set -e


# Replaces all occurrences of org.openfoodfacts.scanner -> openfoodfacts.github.scrachx.openfood for the F-Droid listing

cd ../packages/smooth_app/android/ && grep -rli 'org.openfoodfacts.scanner' * | xargs -i@ sed -i 's/org.openfoodfacts.scanner/openfoodfacts.github.scrachx.openfood/g' @
18 changes: 14 additions & 4 deletions packages/smooth_app/lib/widgets/smooth_product_carousel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,20 @@ class _SearchCardTagLineState extends State<_SearchCardTagLine> {
};
}

Future<bool> _isApplicationDeprecated() {
return PackageInfo.fromPlatform().then(
(PackageInfo value) => value.packageName != 'org.openfoodfacts.scanner',
);
Future<bool> _isApplicationDeprecated() async {
final PackageInfo info = await PackageInfo.fromPlatform();

// The normal packageName
if (info.packageName == 'org.openfoodfacts.scanner') {
return false;
}

// packageName used on F-Droid
if (info.packageName == 'openfoodfacts.github.scrachx.openfood') {
return false;
}

return true;
}
}

Expand Down

0 comments on commit 623e306

Please sign in to comment.