nim: Build nim application deb package in GitHub Actions (2026/02)
We can make applications with nim language on debian-like operating systems. And if you want to share the application, making it into package is a nice idea.
When you want to automate the packaging with GitHub Actions, building and packaging in GitHub Actions are not easy for nim application in my case.
This article explains the build and package method with GitHub Actions environment
TL;DR
- If you use the OS shipment nim version, it is easier than nim specific version.
- Debian packaging is complex and hard to find its method, but the automate is easy with this article.
Introduction
If you choice the OS shipment nim version, it is not difficult to automate build. You can skip this section and write automated build in GitHub workflow file, no extra script is needed.
If you choice the specific nim version (like me), it is difficult to automate build in GitHub Actions. Please following steps.
1. Prepare the Debian packaging script
After the build of your application, Now time to create the Debian packaging.
You can find many debian packaging document in the Internet, But most of these are for debian maintainers and it is for traditional C program.
In our case, where is the document for packaging nim application? I can't find it. So I refer a data packaging from ``
(OS-provided nim) packaging with nim source
You can write the debian rules straight forward.
Add the following Debian packaging files into your project
Project root
|
+-- src ... Your source files with nim
|
+-- build -- rules --+ ... Tempolary rule folder
|
+-- rules ... Build script (important)
|
+-- install ... Install information (important)
|
+-- control ... Package information
|
+-- README.Debian ... Text
|
+-- changelog ... Text
|
+-- files ... Text
Please see my example in the following links:
(Specific nim version) packaging with C source
2. Prepare the automated build
3. Prepare the GitHub workflow file
Push the git and got deb package
What make packaging hard way in GitHub Action
Faield to make deb package with my favorite version of nim
We can build and test the nim application with the GitHub action
by nice `, thank youdom/` for the providing.
But in my case, The deb packaging can't be run in GitHub Actions.
This article explains the situation of its errors.
And the solution is just using the OS ship version of nim compiler. ( I don't have the solution for Windows and Mac environment, Please share me your solution for them. )
Issue: Can't be found the user compiler with debuild in GitHub Actions
When you make the GitHub Action yaml, you will face the several errors for the compiler in user environment.
This is the normal behavior, so we should use the OS shipment compiler or libraries strictly by the debian shipment policy.
コメント
Comments powered by Disqus