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

Publish a Release apk in Github Releases #2011

Closed
chromer030 opened this issue Apr 21, 2021 · 16 comments
Closed

Publish a Release apk in Github Releases #2011

chromer030 opened this issue Apr 21, 2021 · 16 comments

Comments

@chromer030
Copy link

Feature description

Please publish a release apk for every version , because fdroid is very slow in updating its repositiory.
I know we can use debug apk from github action but it has more size in compare to release version.
Thank you.
Reference implementation

@Yonle
Copy link

Yonle commented Apr 21, 2021

Well i agree with this

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Apr 21, 2021

We don't have access to signing keys for the F-Droid releases, they manage it themselves. So we can't release an APK that's compatible with F-Droid releases on github.

We currently have 3 different variants, google play, f-droid and debug builds, which aren't compatible with each other. We already have to deal with a lot of users reporting issues about google play/f-droid incompatibility, adding another variant would cause even more issues.

I know we can use debug apk from github action but it has more size in compare to release version.

The latest one is 89MB, the last fdroid release is 85MB, and v0.109 added a lot of code, so increased size is likely due to it. So "more size" would be insignificant. Moreover, obfuscation has been disabled in v0.109, so even F-droid releases now will have similar sizes to debug builds.

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Apr 21, 2021

The fdroiddata current build server activity shows that termux v0.109 builds have been failing internally. A commit is referenced which is probably the issue It's the version of the fdroidserver that ran the build, build failure info is here and here. Been happening since the 15th, that's probably why an update still hasn't been released. So kindly wait, it should hopefully be released soon.

@agnostic-apollo
Copy link
Member

I have updated the README with detailed info about this. I have also added the debug APK link in the v0.111 release. I guess adding the debug APK link to each release is something doable by maintainers so that users who want to quickly get the update can do so without having to look for it.

Closing this for now since currently there are no plans for an alternate source. Can be opened again if ever needed.

@hrap1919
Copy link

hrap1919 commented Apr 21, 2021

BTW, I just uploaded the release build of my fork https://github.com/hrap1919/termux-app/releases/tag/v0.111. It is built manually with the developer keys, so it is compatible with the artifact builds from the main branch. It has no bootstrap-archives and can be installed as an "update" of the full debug build.

The debug builts of this fork can be obtained via Github Actions as well. The size is slightly larger than the release.

@agnostic-apollo
Copy link
Member

According to the metadata/com.termux.yml file history referenced by Build Metadata on Termux F-Droid page, the F-Droid guys have tried to fix the build failures 3 times already, but it failed today as well. And currently only v0.109 has been added to the metadata/com.termux.yml file, the later versions would probably be added after the current build succeeds.

@jspricke
Copy link

Hi,

the app fails to build because of:

2021-04-22 00:26:39,572 ERROR: Found unknown maven repo 'https://maven.pkg.github.com/termux/termux-app' at termux-shared/build.gradle

You are using a private maven repo which is not allowed on F-Droid.

New version are not picked up because you changed the version code logic making the F-Droid bot fail to pick them up. If you could revert a6ae656, that would solve it.

Thanks!

@jspricke
Copy link

For reference, you can find the list of allowed maven repos here: https://f-droid.org/docs/Build_Metadata_Reference/#build_srclibs
maybe you can use one of them?

@agnostic-apollo
Copy link
Member

Hi @jspricke,

Thanks for reporting in. We were previously hosting on Bintray but had to move to Github Packages since its being shut down. Just to be clear, are you saying that our Github Packages Maven repository here is not allowed by F-Droid and we need to shift to one that is allowed before builds will succeed? If yes, any reference implementations you know of would be of great help if you have the time, otherwise will look ourselves. Thanks

New version are not picked up because you changed the version code logic making the F-Droid bot fail to pick them up. If you could revert a6ae656, that would solve it.

I will change back the logic and make a new release. Will there will be a jump in versions on F-Droid?

Thanks a lot.

@jspricke
Copy link

Just to be clear, are you saying that our Github Packages Maven repository here is not allowed by F-Droid and we need to shift to one that is allowed before builds will succeed?

Yes.

If yes, any reference implementations you know of would be of great help if you have the time, otherwise will look ourselves.

See the link in my comment above.

I will change back the logic and make a new release. Will there will be a jump in versions on F-Droid?

Thanks! F-Droid updatebot will find the new version then, so all should be fine.

@agnostic-apollo
Copy link
Member

agnostic-apollo commented Apr 22, 2021

Yes.

Okay, I asked caused the move was made on Feb 12, before the v0.108 release on Feb 21, which succeeded and is currently available. I see that patches were made for terminal-view and terminal-emulator packages for v0.108 in com.termux.yml. The v0.109 added a new package named termux-shared but its patch is not added to v0.109 in com.termux.yml, likely why the build is failing, But will look into moving the packages to a different repository, since patches can't be expected to be done on every release and against policy anyways patches are automatically copied over to next version and publishing to private repo is fine to build termux-app but won't work when used by Termux plugins apps since github packages require api keys, so still need to move.

Thanks again.

@jspricke
Copy link

Ha, I totally missed that, I adopted the patch, so it should work now. Thanks!

@agnostic-apollo
Copy link
Member

Great, I assume we still need to move the repository for future versions to comply with policy? Thanks.

@jspricke
Copy link

Great, I assume we still need to move the repository for future versions to comply with policy? Thanks.

There should be no need. F-Droid has a policy for used maven repos, not for published repos (afaik).

@agnostic-apollo
Copy link
Member

That's good to hear. Thanks again for checking in and your contributions :)

@agnostic-apollo
Copy link
Member

So the patch was applied yesterday for update to v0.111 by @jspricke and its build was successful.

The main build logs are posted on F-Droid monitor site, if someone wants to see failed log for v0.109.

agnostic-apollo added a commit that referenced this issue Jun 30, 2021
…ckages

Github Package hosting is considered a private repository since it requires github APIs keys if a hosted library needs to be imported as a dependency. Importing from private repositories is not allowed as per F-Droid policy so termux plugin apps can't import termux libraries as dependencies so hence we move to Jitpack. Check #2011 (comment).

Version number of all published libraries from termux-app must be the same.

Importing can be done with the following way.

Add to root level build.gradle

```
allprojects {
    repositories {
        google()
        mavenCentral()
        //mavenLocal()
        maven { url "https://jitpack.io" }
    }
}
```

Add to app module level build.gradle if you want to import `termux-shared`

```
 dependencies {
    implementation 'com.github.termux:termux-shared:0.115'
}
```

Check https://github.com/jitpack/jitpack.io#building-with-jitpack for other details, like including commit or branch level import.

If you are updating the libraries as well and want to test locally, run `./gradlew publishReleasePublicationToMavenLocal` from root directory of termux-app to publish library to local maven repository. You may need to rebuild project before it, library files will be published at `~/.m2/repository/com/github/termux/termux-shared/0.115`. If you want to import the updated library in a project, then uncomment the `mavenLocal()` line in the build.gradle and run sync gradle with project files.

Making changes to library after dependencies have already been cached without incrementing version number may need deleting gradle cache if syncing gradle files doesn't work after publishing changes. Open gradle right sidebar in android studio, then right click on top level entry, then select "Refresh Gradle Dependencies", which will redownload/refresh all dependencies and will take a lot of time. Instead running `find ~/.gradle/caches/ -type d -name "*com.github.termux*" -prune -exec rm -rf "{}" \; -print` and then running gradle sync should be enough.

Using "com.termux" instead of "com.github.termux" will require a DNS TXT record to be added from git.termux.com to https://github.com/termux at termux.com

https://jitpack.io/docs/#custom-domain-name
@ghost ghost locked and limited conversation to collaborators Oct 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants