Skip to content

Snap GitHub ci#5379

Merged
tobiasdiez merged 31 commits into
JabRef:masterfrom
LyzardKing:snapGithubCI
Oct 7, 2019
Merged

Snap GitHub ci#5379
tobiasdiez merged 31 commits into
JabRef:masterfrom
LyzardKing:snapGithubCI

Conversation

@LyzardKing

Copy link
Copy Markdown
Collaborator

This is a sort of working pr of the github actions integration.
I commented out the upload part to test, but the jpackage download url gives a 404.
If you manage to get it to work, without activating the snap upload to the store it would be interesting to see if the snap is uploaded correctly to the jabref server, like the other builds..


  • Change in CHANGELOG.md described
  • Tests created for changes
  • Manually tested changed features in running JabRef
  • Screenshots added in PR description (for bigger UI changes)
  • Ensured that the git commit message is a good one
  • Check documentation status (Issue created for outdated help page at help.jabref.org?)

@LyzardKing

LyzardKing commented Oct 2, 2019

Copy link
Copy Markdown
Collaborator Author

Thanks for looking at it @tobiasdiez ...
unfortunately the jpackage tar returns a 404, it's no longer available on the oracle webpage!!
The rest of your fixes are great! I'm still learning how github actions work...

@tobiasdiez

Copy link
Copy Markdown
Member

Yep, they updated to a later build and thus the paths changed. I tried to fix it with #5380 but that does not work at the moment. We have to wait a bit until some breaking changes to the jpackage interface are propagated trough the tool chain.

@tobiasdiez

Copy link
Copy Markdown
Member

So the build is fixed upstream. Could you please rebase/merge the latest changes. Thanks

@LyzardKing

Copy link
Copy Markdown
Collaborator Author

I had to merge because there were too many changes for a proper rebase, and it was not working properly..
At the end, if the snap build process works we can merge as a single commit to keep the git log a bit cleaner, now let's see it if works!

@tobiasdiez

Copy link
Copy Markdown
Member

There are some problems with the snap build. Moreover, I was wondering if it is really necessary to wrap everything in the docker. apt get install snap raft (maybe after add-apt-repository ppa:snappy-dev/tools) is not possible?

@LyzardKing

Copy link
Copy Markdown
Collaborator Author

Unfortunately it's not possible, being a core18 snap it needs to be built in a vm (multipass or lxc), and those do not work atm in a github actions vm.
One thing I can do is build a docker bionic image and use that. That should solve the issue

@LyzardKing

Copy link
Copy Markdown
Collaborator Author

There are open issues related to having official support for either an official docker image or support directly in the github CI:
https://bugs.launchpad.net/snapcraft/+bug/1846195
canonical/multipass#1075

@LyzardKing

Copy link
Copy Markdown
Collaborator Author

@tobiasdiez The snap build works now, so it can be uploaded to the jabref repo.
The next thing (that I obviously cannot do) is add the snapcraft secret file as described here: https://forum.snapcraft.io/t/building-and-pushing-snap-packages-from-gitlab/9537
The tldr is:
snapcraft login
snapcraft export-login snapcraft.login
base64 snapcraft.login | xsel --clipboard

paste to the SNAPCRAFT_LOGIN_FILE in secrets

@tobiasdiez

Copy link
Copy Markdown
Member

Perfect! Thanks for your work.

@koppor @Siedlerchr can you please have a look at the upload stuff (and maybe add the login data to the admin repo?). Thanks

@LyzardKing

Copy link
Copy Markdown
Collaborator Author

If you want we could first uncomment the upload to builds.jabred we could test the built snap from there before pushing to the snap store

@tobiasdiez

Copy link
Copy Markdown
Member

It's not possible right now to use secrets in pull requests from forked repositories (https://github.community/t5/GitHub-Actions/Make-secrets-available-to-builds-of-forks/m-p/30678#M508). Thus, we cannot upload something to builds.jabref.org from a forked PR. Thus, I'll merge this now and hope everything runs.

@tobiasdiez tobiasdiez merged commit 1c3802e into JabRef:master Oct 7, 2019
@koppor

koppor commented Oct 7, 2019

Copy link
Copy Markdown
Member

Joining the party late. The snapcraft step is protected by a guard checking for the branch. This is an indicator that a separate "publish-on-snapcraft" workflow should be created. Running on ubuntu-latest and master branch only. Maybe just executing the single step is enough (after checkout).

@LyzardKing

Copy link
Copy Markdown
Collaborator Author

@tobiasdiez Let's see if it works, then it can be moved out in a separate part, to expedite the upload of the other builds

@LyzardKing

Copy link
Copy Markdown
Collaborator Author

It builds and uploads!
I can't download it to test it, but it looks like a good start ;)

@Siedlerchr

Copy link
Copy Markdown
Member

Build was succesful! Congrats! @LyzardKing
Just a few things in the build log:

So the only missing part is the upload to the snapcraft?

The 'gnome-extension' part is missing libraries that are not included in the snap or base. They can be satisfied by adding the following entry for this part
stage-packages:
- libc6
Priming jabref 
The 'jabref' part is missing libraries that are not included in the snap or base. They can be satisfied by adding the following entries to the existing stage-packages for this part:
- libc6
- libgcc1
- libstdc++6
- libtinfo5
- libuuid1
- zlib1g
DEPRECATED: The 'version-script' keyword has been deprecated in favour of the 'snapcraftctl set-version' part scriptlet.

@tobiasdiez

Copy link
Copy Markdown
Member

I agree it would be cleaner to extract the snap action to a separate workflow. However, it seems running workflows sequentially is not yet supported: https://github.community/t5/GitHub-Actions/Github-Actions-trigger-workflow-on-Succes-Failure-of-other/td-p/17944

@LyzardKing

Copy link
Copy Markdown
Collaborator Author

@Siedlerchr The missing libraries error should actually be ignored because they are all in the gnome-extention snap.
The version-script can be fixed when the version is set in the jpackage tarball (I believe)

@Siedlerchr

Copy link
Copy Markdown
Member

@LyzardKing Thanks for the update. Btw, I added you as collaborator, so you can directly create a new branch at the JabRef repo and can test it without needing to specify any secrets in your fork

@LyzardKing

Copy link
Copy Markdown
Collaborator Author

Thanks!!
I'll create a branch when there's a new update to fix the snap then!
The one thing that needs work now is the snap store integration (the commented line under the snapcraft command in the github actions script)

SNAPCRAFT_LOGIN_FILE: ${{ secrets.SNAPCRAFT_LOGIN_FILE }}
run: |
docker run -v $(pwd):$(pwd) -t lyzardking/snapcraft-bionic sh -c "apt update -qq && cd $(pwd) && snapcraft && mv jabref*.snap build/distribution/"
# cd build/distribution/ && mdkir .snapcraft && echo ${SNAPCRAFT_LOGIN_FILE} | base64 --decode --ignore-garbage > .snapcraft/snapcraft.cfg && snapcraft push --release=beta *.snap

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This part needs secrets and activations as proposed in #5379 (comment)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@koppor can you have a look here? thanks!

@koppor

koppor commented Oct 7, 2019 via email

Copy link
Copy Markdown
Member

@Siedlerchr

Copy link
Copy Markdown
Member

@koppor The snap build reuses the jpackage build

This was referenced Oct 9, 2019
@koppor

koppor commented Oct 12, 2019

Copy link
Copy Markdown
Member

Follow up discussions regarding the build at #5417.

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.

4 participants