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

Guess update information based on GitHub Actions environment variables #1075

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

srevinsaju
Copy link
Contributor

Reads the GITHUB_REPOSITORY and GITHUB_REF environment variables
and attempts to generate an appropriate updateinformation

Adapted from https://github.com/probonopd/go-appimage/blob/7fab45552eb485c0076fd310835fa7958f981de0/src/appimagetool/appimagetool.go\#L547-L567

Sample run

github@fbfcaab3b211:~/build/out$ export GITHUB_REPOSITORY='probonopd/Zoom.AppImage'
github@fbfcaab3b211:~/build/out$ appimagetool appimagetool.AppDir/ -g             
appimagetool, continuous build (commit 0880085), build <local dev build> built on 2020-09-09 20:44:40 UTC
WARNING: appstreamcli command is missing, please install it if you want to use AppStream metadata
NOTE: Using the output of 'git rev-parse --short HEAD' as the version:
      0880085
      Please set the $VERSION environment variable if this is not intended
Using architecture x86_64
/home/github/build/out/appimagetool.AppDir should be packaged as appimagetool-0880085-x86_64.AppImage
AppStream upstream metadata found in usr/share/metainfo/appimagetool.appdata.xml
Generating squashfs...
Parallel mksquashfs: Using 8 processors
Creating 4.0 filesystem on appimagetool-0880085-x86_64.AppImage, block size 131072.
[========================================================================================/] 19/19 100%

Exportable Squashfs 4.0 filesystem, gzip compressed, data block size 131072
        compressed data, compressed metadata, compressed fragments,
        compressed xattrs, compressed ids
        duplicates are removed
Filesystem size 461.61 Kbytes (0.45 Mbytes)
        39.67% of uncompressed filesystem size (1163.54 Kbytes)
Inode table size 317 bytes (0.31 Kbytes)
        39.33% of uncompressed inode table size (806 bytes)
Directory table size 319 bytes (0.31 Kbytes)
        56.36% of uncompressed directory table size (566 bytes)
Number of duplicate files found 2
Number of inodes 24
Number of files 12
Number of fragments 2
Number of symbolic links  0
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 12
Number of ids (unique uids + gids) 1
Number of uids 1
        root (0)
Number of gids 1
        root (0)
Embedding ELF...
Marking the AppImage as executable...
Running on GitHub Actions
Guessing update information based on $GITHUB_REPOSITORY=probonopd/Zoom.AppImage and $GITHUB_REF=refs/heads/featureA
gh-releases-zsync|probonopd|Zoom.AppImage|continuous|appimagetool*-x86_64.AppImage.zsync
Embedding MD5 digest
zsyncmake is available and updateinformation is provided, hence generating zsync file
Success

Please consider submitting your AppImage to AppImageHub, the crowd-sourced
central directory of available AppImages, by opening a pull request
at https://github.com/AppImage/appimage.github.io
github@fbfcaab3b211:~/build/out$

@srevinsaju
Copy link
Contributor Author

@probonopd this is my first C lang based PR, so please let me know of corrections

Copy link
Member

@TheAssassin TheAssassin left a comment

Choose a reason for hiding this comment

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

The idea is okay, but the implementation needs to be improved. I commented on most of the problems. Please fix, I'll re-review then.

src/appimagetool.c Outdated Show resolved Hide resolved
src/appimagetool.c Outdated Show resolved Hide resolved
src/appimagetool.c Outdated Show resolved Hide resolved
src/appimagetool.c Outdated Show resolved Hide resolved
src/appimagetool.c Outdated Show resolved Hide resolved
@srevinsaju srevinsaju marked this pull request as ready for review September 10, 2020 13:19
@srevinsaju
Copy link
Contributor Author

@TheAssassin I guess I fixed the issues which you mentioned. Please review again.

Copy link

@LautaroLobo12 LautaroLobo12 left a comment

Choose a reason for hiding this comment

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

LGTM!

@srevinsaju
Copy link
Contributor Author

@TheAssassin if you have few minutes to spare, could you please review this merge request, so that I can update accordingly? Thanks!!

Copy link
Member

@TheAssassin TheAssassin left a comment

Choose a reason for hiding this comment

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

Noted the most important problems. Will re-check when those are fixed.

src/appimagetool.c Outdated Show resolved Hide resolved
src/appimagetool.c Outdated Show resolved Hide resolved
src/appimagetool.c Outdated Show resolved Hide resolved
src/appimagetool.c Outdated Show resolved Hide resolved
src/appimagetool.c Show resolved Hide resolved
src/appimagetool.c Show resolved Hide resolved
src/appimagetool.c Outdated Show resolved Hide resolved
src/appimagetool.c Outdated Show resolved Hide resolved
@probonopd
Copy link
Member

Hello @srevinsaju do you think you can address the points raised by @TheAssassin and @codewiz above? I'd really like to see this merged for probonopd/Zoom.AppImage#1.

@srevinsaju
Copy link
Contributor Author

srevinsaju commented Nov 15, 2020

I am having my first semester starting from tomorrow 🥶 , apologize for the delay. I would try to finish it as soon as the exams finish 🥇

image
its growing white 😅

@srevinsaju
Copy link
Contributor Author

This "constant" is irrelevant to the rest of the file. Also, the code doesn't use such a convention anyway.

@TheAssassin so you mean, I should not use a constant? and keep literals, or move the constant a bit more down?

@TheAssassin
Copy link
Member

A static const int is sufficient.

@srevinsaju
Copy link
Contributor Author

A static const int is sufficient.

At the same position where it is, right?

@TheAssassin
Copy link
Member

Obviously not. You should place it before the first use.

@srevinsaju
Copy link
Contributor Author

Obviously not. You should place it before the first use.

ok, got it!

@srevinsaju
Copy link
Contributor Author

@TheAssassin I hope I fixed all of what you have mentioned above.
This Pull Request was a great opportunity to learn more about C, and how dangerous it can be, if not used properly. Thanks to @codewiz.

This makes me think about using more safer languages like Rust, or at least modern C++.

@TheAssassin kindly review

@probonopd
Copy link
Member

probonopd commented Nov 22, 2020

This makes me think about using more safer languages

Like Golang? Reminds me of probonopd/go-appimage#99 :)

@srevinsaju
Copy link
Contributor Author

Yea GoLang can be considered as a safe language too. I am interested in v2 of GoLang, its more interesting 🚀

If I go by preference of languages:

  1. Rust (new language for me, static binaries, super fast)
  2. GoLang (easy to code, understand, functional)
  3. C++ (20?)

@probonopd
Copy link
Member

Reference: probonopd/linuxdeployqt#316

@yozachar
Copy link

yozachar commented Apr 25, 2021

Hi, is the PR still maintained? It's says this branch is out-of date with the base, I'd like to see this feature, how can I help? Coming from probonopd/Zoom.AppImage#1

@srevinsaju
Copy link
Contributor Author

Hi, is the PR still maintained? It's says this branch is out-of date with the base, I'd like to see this feature, how can I help?

Updated.

@probonopd
Copy link
Member

probonopd commented Apr 25, 2021

Thanks for updating @srevinsaju.

Hello @TheAssassin

Noted the most important problems. Will re-check when those are fixed.

Would be great if you could re-check if you find the time. I think this would be valuable to get merged soon.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants