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

Allow version suffix #201

Merged
merged 2 commits into from
Dec 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/constants/app_constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,10 @@ const String PRIVACY = 'Privacy Policy';
const String TERMS = 'Terms';

String projectLink(String path, {String? blob}) {
final finalBlob =
final blobOrDefault =
blob ?? const String.fromEnvironment("version", defaultValue: "main");
return 'https://github.com/LeastAuthority/destiny/blob/$finalBlob/$path';
final targetBlob = blobOrDefault.split("-").first;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To understand..

  1. create tag for release: 1.0.3-fdroid in github
  2. this trigger CI, where we set version: name:
"Set version string for release"
        run: echo DESTINY_VERSION=${{ github.ref_name }} >> $GITHUB_ENV
        if: ${{ github.ref_type == 'tag' }}
  1. CI generates build with link:
    https://github.com/LeastAuthority/destiny/blob/1.0.3/TERMS.md
    instead of https://github.com/LeastAuthority/destiny/blob/1.0.3-fdroid/TERMS.md
    because according logic, we will split string via separator - and take only first part 1.0.3

However in github valid tag is 1.0.3-froid and it means file is available only
https://github.com/LeastAuthority/destiny/blob/1.0.3-fdroid/TERMS.md, not at https://github.com/LeastAuthority/destiny/blob/1.0.3/TERMS.md

In destiny application, when user clicks on Terms link we provide link to exact file of that version, that Terms version would correlate with app version.

Or maybe I misunderstand something..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The format of the tag is not affected by this change. It would just allow using a version name 1.0.3-fdroid and still. be able to use the per version Terms URL.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we are ok as long as we don't create tag 1.0.3-fdroid in github tag for releases

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A F-Droid release will be triggered with any tag in the format 1.0.3. That -fdroid just will be appended during the build itself.

return 'https://github.com/LeastAuthority/destiny/blob/$targetBlob/$path';
}

final String FEEDBACK_LINK = projectLink('FAQ.md#contact', blob: "main");
Expand Down