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

Set up GitHub actions #68

Merged
merged 1 commit into from
Apr 27, 2024
Merged

Set up GitHub actions #68

merged 1 commit into from
Apr 27, 2024

Conversation

zjeffer
Copy link
Collaborator

@zjeffer zjeffer commented Apr 25, 2024

No description provided.

@Duckonaut
Copy link
Owner

I see you're working on this, I'm thinking it would be a good idea to verify against Hyprland git and maybe two latest tagged releases (arbitrary number, but convenient because that's how many we have pinned right now 😄). I'll play a bit with it to make it work, should probably be 3 separate workflows

@zjeffer
Copy link
Collaborator Author

zjeffer commented Apr 26, 2024

We could maybe make two types of workflows:

  1. Nightly workflow: builds the latest x pins and the current git version of Hyprland and this repo.
  2. Pull request workflows: builds the pull request branch with the latest hyprland-git version. Optionally we could require the pull request to successfully build before being able to merge.

@zjeffer
Copy link
Collaborator Author

zjeffer commented Apr 26, 2024

Right now I'm stuck at the checkout step, though. For some reason the step doesn't have appropriate permissions?

image

This is perhaps because I'm using my own image of Arch + Hyprland and changing the user in that Docker image?

@Duckonaut
Copy link
Owner

Could be, I'd assume the checkout action runs as some github user that's assumed to exist in the "standard" images

@Duckonaut
Copy link
Owner

Is there a reason for using checkout@v2 though? I see there's checkout@v4 out by now

@zjeffer
Copy link
Collaborator Author

zjeffer commented Apr 27, 2024

@Duckonaut In this commit, I added an action that would build the base Dockerfile every night, and pushes it to docker hub. I'd rather not put this image on my own docker hub account, though, because then I'd have to give you an access token to add to the GitHub secrets ;)

Would you be willing to add your docker hub username and access token to the GitHub secrets of this repo, so we can build and publish this image automatically? I assume this is your account: https://hub.docker.com/u/duckonaut ?

With this continuously updated image, we can ensure we're building hyprland and the plugin from the most recent version of Arch.

@Duckonaut
Copy link
Owner

That makes sense. I'll put the credentials in the secrets and we'll see how it goes

@Duckonaut
Copy link
Owner

Alright, done. Change the image to pull and see if it works correctly

@zjeffer
Copy link
Collaborator Author

zjeffer commented Apr 27, 2024

It works :)

* Build and publish the base arch linux image every midnight
* Build the plugin on every PR and push to main, and every night at 2AM
@zjeffer zjeffer marked this pull request as ready for review April 27, 2024 16:06
@zjeffer
Copy link
Collaborator Author

zjeffer commented Apr 27, 2024

I think I'll do the hyprpm pins in another PR, for now this can be merged IMO

@Duckonaut
Copy link
Owner

I can see that, looking good! Github actions really is weird, good that you've made it work

@Duckonaut Duckonaut merged commit 44ec4e8 into main Apr 27, 2024
1 check passed
@zjeffer
Copy link
Collaborator Author

zjeffer commented Apr 27, 2024

I got a lot of help from GitHub copilot 😉 (that's why it suggested checkout@v2 😅)

@zjeffer zjeffer deleted the github-actions branch April 27, 2024 16:19
@zjeffer
Copy link
Collaborator Author

zjeffer commented Apr 27, 2024

I'm wondering how we would do the pins thing... Say we want to build the plugin for the latest two commits (currently v38.1 and v39.1), we'd have to install Hyprland's dependencies that work with those versions of Hyprland, and then compile Hyprland from the release tag. It seems quite difficult to find the correct versions of the dependencies that work for those Hyprland releases.

Maybe we have to find a way to not have to build hyprland, but just make sure the headers are included so the plugin can build? That way we could just clone the Hyprland repo without having to install anything.

@Duckonaut
Copy link
Owner

I'm wondering how we would do the pins thing... Say we want to build the plugin for the latest two commits (currently v38.1 and v39.1), we'd have to install Hyprland's dependencies that work with those versions of Hyprland, and then compile Hyprland from the release tag. It seems quite difficult to find the correct versions of the dependencies that work for those Hyprland releases.

Maybe we have to find a way to not have to build hyprland, but just make sure the headers are included so the plugin can build? That way we could just clone the Hyprland repo without having to install anything.

It would be pretty tough to resolve the dependencies for past releases. I guess we could drop it and just test on -git and latest tagged in Arch repositories, Arch installs headers and I think realistically for now it's all we need to care about.

Alternatively, we could set up a scheme with Docker images. We'd have 3 docker images

  • git, rebuilt daily from hyprland-git
  • latest, rebuilt on Hyprland major version change from Arch packages
  • past, which would just be the previous latest moved to a different tag.

Or we could mess with Nix for this, it would resolve the dependencies for Hyprland correctly, and we could build Hyprland with Nix on Arch, then export the headers to the standard location.

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.

2 participants