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

Packaging process and systemd service #43

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

zachfeldman
Copy link
Contributor

@zachfeldman zachfeldman commented Jun 11, 2023

Closes #47 .

This adds a very simple packaging process and systemd service file for the inputmodule-rs to run. I have it running the ledmatrix by default now but the idea is to quickly iterate on this to a more general service to take commands via dbus or similar as we've discussed!

For now, it generally works. To cut a release, run ./release.sh. It'll install fpm (https://github.com/jordansissel/fpm) if you're missing it and use it to package up the binary that cargo builds into a .deb.

Once you install the package with dpkg -i <package-name>.deb, it'll run a postinstall script to install the udev rule and it will automatically add the systemd service and start it. It should persist between reboots.

Some other things to consider:

  • We may want to run release.sh as part of the build, eventually convert it to a Makefile, or eventually use something like bazel to run the build and packaging process if we want to get really fancy
  • We might not want to commit the released .debs, but I included one to easily try installing it with dpkg
  • We may also want to release a .rpm for RHEL-based distros eventually
  • Obviously we'll need something completely separate for Windows at some point, but this is a start!

@zachfeldman zachfeldman changed the base branch from main to better-port-permission-setup-and-errors June 11, 2023 12:37
Copy link
Member

@JohnAZoidberg JohnAZoidberg left a comment

Choose a reason for hiding this comment

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

I have some suggestions:

  • Let's build the package on GH Actions and not put it in the repo
  • Move all release scripts into a subfolder, maybe release/
  • Add trailing newlines to the end of files (I don't get why vscode doesn't do that)

@zachfeldman zachfeldman force-pushed the packaging-process-and-systemd-service branch 7 times, most recently from d333a86 to 93e7aae Compare June 13, 2023 12:40
@zachfeldman
Copy link
Contributor Author

@JohnAZoidberg all good suggestions! I've implemented them all. Put the new release action into a separate .yml/action, thinking we could run it only whenever a release branch is pushed (starting in release/) or on some other trigger vs on every single build, if you'd like. We could also merge this into software.yml or firmware.yml if preferred.

@zachfeldman zachfeldman force-pushed the better-port-permission-setup-and-errors branch from 9a55c4f to 247bc18 Compare August 11, 2023 13:57
@zachfeldman zachfeldman force-pushed the packaging-process-and-systemd-service branch from 93e7aae to 5535376 Compare August 11, 2023 13:59
@zachfeldman
Copy link
Contributor Author

@JohnAZoidberg same question here! (Although this is currently just merging into my other branch :))

Base automatically changed from better-port-permission-setup-and-errors to main August 25, 2023 09:03
@zachfeldman zachfeldman force-pushed the packaging-process-and-systemd-service branch from 20b25e8 to 2b678b1 Compare October 9, 2023 19:50
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