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

Should we have a proper CI in GitHub? #52

Closed
asandikci opened this issue Apr 7, 2024 · 17 comments
Closed

Should we have a proper CI in GitHub? #52

asandikci opened this issue Apr 7, 2024 · 17 comments
Labels
👍 planned Officially planned for a future release

Comments

@asandikci
Copy link

Could you please have CI (GitHub Actions) for building/publishing app instead of building it locally and uploading manually. This provides a better security for users. Thanks in advance

@polymorphicshade polymorphicshade added the 👍 planned Officially planned for a future release label Apr 7, 2024
@ghost
Copy link

ghost commented Apr 18, 2024

Trying to make it possible and open a PR but I am having this issue at the checkout step:
Error: error: unable to create symlink app/src/main/res/layout-land/list_stream_card_item.xml: File name too long

Can you please take a look at this so I can handle the rest.

https://github.com/TheKyber/Tubular/actions/runs/8737197493/job/23973640700

I tried the checkout on NewPipe and it worked just fine, so the problem is only in your repo I guess.

https://github.com/TheKyber/Tubular/actions/runs/8744060319/job/23996088644

@licaon-kter
Copy link

Seeing the same locally :(

@polymorphicshade
Copy link
Owner

@asandikci @thekyber @licaon-kter - could one of you look at the dev branch so far and see the CI/Release workflows I added? I'm relatively new to Github Actions so let me know if I'm missing anything.

As for the symlink thing, I work and develop with Windows machines, and the symbolic link for list_stream_card_item.xml was breaking the build on my machine, so I just copied the contents of the linked file. I have no idea how this may effect Git's ability to checkout the source code... Nonetheless I tweaked the workflow scripts to manually checkout the source code and I don't have this symlink problem anymore.

@ghost
Copy link

ghost commented Apr 20, 2024

@polymorphicshade I see that you solved the checkout problem and I am going to copy some of your workflow to mine before opening a PR.

The ci.yml file looks good for me because it is for testing purposes, so it builds the debug apk and uploads it as an artifact that can be found in the details of the workflow run.

Howerver, I don't understand why are you uploading the release apk in release.yml also as an artifact, I assume that you wanted to upload it to the releases right?

Well, there should be also a step where you create a new release before uploading the apk file to it, and I am happy to help you with that.

The workflow that i am trying to make can create the tag and the release automatically by extracting the versionName from app/build.gradle. I will be testing it and keep you updated if there is anything new.

Feel free to ask anything altghouh I consider myself a beginner in GitHub Actions.

@ghost
Copy link

ghost commented Apr 20, 2024

5b6b243

You can also remove this commit if you want, because I like to sign the apk in a different step.

@polymorphicshade
Copy link
Owner

@thekyber my intention was to manually make releases (so I can put in whatever detail I want), and manually attach an APK generated by the Release workflow.

I wanted keep the creation of the release separate from the "release" build and sign stuff in the workflow.

Is this a bad idea?

@ghost
Copy link

ghost commented Apr 20, 2024

@polymorphicshade
To publish the apk file yourself you will have to download the artifact, unzip it locally, and then reupload it, is it really worth the trouble?

I also don't understand why do you want to create the release manually.

The only reason I see for you to do this is to write some release notes before publishing everything, but this also can be automated when you keep the release notes in a sepeate file (I don't know how to do this but I will see what I can do about it).

@polymorphicshade
Copy link
Owner

@thekyber oh I like that a lot better. Good idea 👍

@ghost
Copy link

ghost commented Apr 20, 2024

@polymorphicshade
From what I saw in some workflows, you need to make a file that you will keep the release notes in it, then it will be included when creating the release so it will get the notes from there, should I take a look on how to do this?

@ghost
Copy link

ghost commented Apr 20, 2024

@polymorphicshade
By the way, I rely on GitHub CLI to handle the release creation and upload, but if you find it a bit confusing you can use something simpler and clearer from GitHub Marketplace, like this one:

https://github.com/marketplace/actions/create-release

@polymorphicshade
Copy link
Owner

@thekyber if you're already in the middle of figuring this out, go for it. I have very little free time, so you will probably end up with a solution before I do.

@ghost
Copy link

ghost commented Apr 20, 2024

@polymorphicshade

I managed to do it and it was pretty easy, you just have to create changelog.md file (or any other name), you write what you want it to be in the latest release notes, you include it in your workflow, and you're done.

This is my test:
https://github.com/thekyber/Tubular/releases/latest

The PR is ready to be merged.

@licaon-kter
Copy link

I can't even clone

$ git clone https://github.com/polymorphicshade/Tubular
Cloning into 'Tubular'...
remote: Enumerating objects: 133030, done.
remote: Counting objects: 100% (3463/3463), done.
remote: Compressing objects: 100% (1150/1150), done.
remote: Total 133030 (delta 1755), reused 3379 (delta 1700), pack-reused 129567
Receiving objects: 100% (133030/133030), 113.12 MiB | 11.52 MiB/s, done.
Resolving deltas: 100% (80505/80505), done.
error: unable to create symlink app/src/main/res/layout-land/list_stream_card_item.xml: File name too long
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

@ghost
Copy link

ghost commented Apr 24, 2024

I can't even clone

git clone --no-checkout https://github.com/polymorphicshade/Tubular

@licaon-kter
Copy link

$ git clone --no-checkout https://github.com/polymorphicshade/Tubular
Cloning into 'Tubular'...
remote: Enumerating objects: 133599, done.
remote: Counting objects: 100% (4032/4032), done.
remote: Compressing objects: 100% (1342/1342), done.
error: 4489 bytes of body are still expected2 MiB | 2.41 MiB/s  
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

In the context of F-Droid this will trigger protections https://git-scm.com/docs/git-fsck

Why is the repo problematic? Why do we need no-checkout? why is the index invalid?

@ghost
Copy link

ghost commented Apr 24, 2024

Why is the repo problematic? Why do we need no-checkout? why is the index invalid?

I really don't know, try to delete it before cloning again.
I got this using the command I gave you:

Cloning into 'Tubular'...
remote: Enumerating objects: 133599, done.
remote: Counting objects: 100% (4032/4032), done.
remote: Compressing objects: 100% (1342/1342), done.
remote: Total 133599 (delta 2035), reused 3923 (delta 1973), pack-reused 129567
Receiving objects: 100% (133599/133599), 113.33 MiB | 1.37 MiB/s, done.
Resolving deltas: 100% (80785/80785), done.

@eighthave
Copy link

fsck is not enabled by default (though IMHO it should be). Try:

$ git -c fetch.fsckObjects=true clone https://github.com/polymorphicshade/Tubular.git
Cloning into 'Tubular'...
remote: Enumerating objects: 133599, done.
remote: Counting objects: 100% (4032/4032), done.
remote: Compressing objects: 100% (1342/1342), done.
remote: Total 133599 (delta 2035), reused 3923 (delta 1973), pack-reused 129567
Receiving objects: 100% (133599/133599), 113.33 MiB | 17.54 MiB/s, done.
Resolving deltas: 100% (80785/80785), done.
error: unable to create symlink app/src/main/res/layout-land/list_stream_card_item.xml: File name too long
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👍 planned Officially planned for a future release
Projects
None yet
Development

No branches or pull requests

4 participants