release: package compiler as AppImage
b7e438e parent: a52696f modified
.github/workflows/release.yml +25 -15 | @@ -74,19 +74,31 @@ jobs: | ||
| 74 | 74 | |
| 75 | 75 | - name: Package release |
| 76 | 76 | run: | |
| 77 | - install -Dm755 bin/clonim dist/clonim-linux-x86_64 | |
| 78 | - install -Dm644 lib/libclonim_runtime.a dist/libclonim_runtime.a | |
| 79 | - cd dist | |
| 80 | - sha256sum clonim-linux-x86_64 libclonim_runtime.a > SHA256SUMS | |
| 77 | + appdir=dist/clonim.AppDir | |
| 78 | + install -Dm755 bin/clonim "$appdir/usr/bin/clonim" | |
| 79 | + install -Dm644 lib/libclonim_runtime.a \ | |
| 80 | + "$appdir/usr/bin/libclonim_runtime.a" | |
| 81 | + install -Dm644 packaging/appimage/clonim.desktop \ | |
| 82 | + "$appdir/clonim.desktop" | |
| 83 | + install -Dm644 packaging/appimage/clonim.svg "$appdir/clonim.svg" | |
| 84 | + ln -s usr/bin/clonim "$appdir/AppRun" | |
| 85 | + ln -s clonim.svg "$appdir/.DirIcon" | |
| 86 | + | |
| 87 | + curl --fail --location --silent --show-error \ | |
| 88 | + https://github.com/AppImage/appimagetool/releases/download/1.9.1/appimagetool-x86_64.AppImage \ | |
| 89 | + -o /tmp/appimagetool-x86_64.AppImage | |
| 90 | + echo "ed4ce84f0d9caff66f50bcca6ff6f35aae54ce8135408b3fa33abfc3cb384eb0 /tmp/appimagetool-x86_64.AppImage" \ | |
| 91 | + | sha256sum --check | |
| 92 | + chmod +x /tmp/appimagetool-x86_64.AppImage | |
| 93 | + ARCH=x86_64 APPIMAGE_EXTRACT_AND_RUN=1 \ | |
| 94 | + /tmp/appimagetool-x86_64.AppImage \ | |
| 95 | + "$appdir" dist/clonim-linux-x86_64.AppImage | |
| 81 | 96 | |
| 82 | 97 | - name: Upload workflow artifact |
| 83 | 98 | uses: actions/upload-artifact@v4 |
| 84 | 99 | with: |
| 85 | 100 | name: clonim-${{ steps.release.outputs.tag }}-linux-x86_64 |
| 86 | - path: | | |
| 87 | - dist/clonim-linux-x86_64 | |
| 88 | - dist/libclonim_runtime.a | |
| 89 | - dist/SHA256SUMS | |
| 101 | + path: dist/clonim-linux-x86_64.AppImage | |
| 90 | 102 | if-no-files-found: error |
| 91 | 103 | retention-days: 90 |
| 92 | 104 | |
| @@ -98,13 +110,11 @@ jobs: | ||
| 98 | 110 | body: | |
| 99 | 111 | Linux x86_64 release of clonim. |
| 100 | 112 | |
| 101 | - Download `clonim-linux-x86_64` and `libclonim_runtime.a` into the | |
| 102 | - same directory. Generated programs statically link the runtime and | |
| 103 | - are standalone. Nim must be installed as the native-code backend. | |
| 113 | + Download the AppImage, make it executable, and run it. It contains | |
| 114 | + both the compiler and its private static runtime. Generated programs | |
| 115 | + statically link the runtime and are standalone. Nim must be installed | |
| 116 | + as the native-code backend. | |
| 104 | 117 | draft: false |
| 105 | 118 | prerelease: false |
| 106 | - files: | | |
| 107 | - dist/clonim-linux-x86_64 | |
| 108 | - dist/libclonim_runtime.a | |
| 109 | - dist/SHA256SUMS | |
| 119 | + files: dist/clonim-linux-x86_64.AppImage | |
| 110 | 120 | fail_on_unmatched_files: true |
| @@ -74,19 +74,31 @@ jobs: | |||
| 74 | 74 | ||
| 75 | - name: Package release | 75 | - name: Package release |
| 76 | run: | | 76 | run: | |
| 77 | - install -Dm755 bin/clonim dist/clonim-linux-x86_64 | 77 | + appdir=dist/clonim.AppDir |
| 78 | - install -Dm644 lib/libclonim_runtime.a dist/libclonim_runtime.a | 78 | + install -Dm755 bin/clonim "$appdir/usr/bin/clonim" |
| 79 | - cd dist | 79 | + install -Dm644 lib/libclonim_runtime.a \ |
| 80 | - sha256sum clonim-linux-x86_64 libclonim_runtime.a > SHA256SUMS | 80 | + "$appdir/usr/bin/libclonim_runtime.a" |
| 81 | + install -Dm644 packaging/appimage/clonim.desktop \ | ||
| 82 | + "$appdir/clonim.desktop" | ||
| 83 | + install -Dm644 packaging/appimage/clonim.svg "$appdir/clonim.svg" | ||
| 84 | + ln -s usr/bin/clonim "$appdir/AppRun" | ||
| 85 | + ln -s clonim.svg "$appdir/.DirIcon" | ||
| 86 | + | ||
| 87 | + curl --fail --location --silent --show-error \ | ||
| 88 | + https://github.com/AppImage/appimagetool/releases/download/1.9.1/appimagetool-x86_64.AppImage \ | ||
| 89 | + -o /tmp/appimagetool-x86_64.AppImage | ||
| 90 | + echo "ed4ce84f0d9caff66f50bcca6ff6f35aae54ce8135408b3fa33abfc3cb384eb0 /tmp/appimagetool-x86_64.AppImage" \ | ||
| 91 | + | sha256sum --check | ||
| 92 | + chmod +x /tmp/appimagetool-x86_64.AppImage | ||
| 93 | + ARCH=x86_64 APPIMAGE_EXTRACT_AND_RUN=1 \ | ||
| 94 | + /tmp/appimagetool-x86_64.AppImage \ | ||
| 95 | + "$appdir" dist/clonim-linux-x86_64.AppImage | ||
| 81 | 96 | ||
| 82 | - name: Upload workflow artifact | 97 | - name: Upload workflow artifact |
| 83 | uses: actions/upload-artifact@v4 | 98 | uses: actions/upload-artifact@v4 |
| 84 | with: | 99 | with: |
| 85 | name: clonim-${{ steps.release.outputs.tag }}-linux-x86_64 | 100 | name: clonim-${{ steps.release.outputs.tag }}-linux-x86_64 |
| 86 | - path: | | 101 | + path: dist/clonim-linux-x86_64.AppImage |
| 87 | - dist/clonim-linux-x86_64 | ||
| 88 | - dist/libclonim_runtime.a | ||
| 89 | - dist/SHA256SUMS | ||
| 90 | if-no-files-found: error | 102 | if-no-files-found: error |
| 91 | retention-days: 90 | 103 | retention-days: 90 |
| 92 | 104 | ||
| @@ -98,13 +110,11 @@ jobs: | |||
| 98 | body: | | 110 | body: | |
| 99 | Linux x86_64 release of clonim. | 111 | Linux x86_64 release of clonim. |
| 100 | 112 | ||
| 101 | - Download `clonim-linux-x86_64` and `libclonim_runtime.a` into the | 113 | + Download the AppImage, make it executable, and run it. It contains |
| 102 | - same directory. Generated programs statically link the runtime and | 114 | + both the compiler and its private static runtime. Generated programs |
| 103 | - are standalone. Nim must be installed as the native-code backend. | 115 | + statically link the runtime and are standalone. Nim must be installed |
| 116 | + as the native-code backend. | ||
| 104 | draft: false | 117 | draft: false |
| 105 | prerelease: false | 118 | prerelease: false |
| 106 | - files: | | 119 | + files: dist/clonim-linux-x86_64.AppImage |
| 107 | - dist/clonim-linux-x86_64 | ||
| 108 | - dist/libclonim_runtime.a | ||
| 109 | - dist/SHA256SUMS | ||
| 110 | fail_on_unmatched_files: true | 120 | fail_on_unmatched_files: true |
modified
README.md +3 -5 | @@ -24,11 +24,9 @@ and a clean working tree. Use `just bench-store 15` to change the threshold; | ||
| 24 | 24 | see [benchmark history](bench/README.md) for metrics and exit codes. |
| 25 | 25 | |
| 26 | 26 | `just release` builds the compiler and its private static runtime. Version tags |
| 27 | -matching `v*` trigger the release workflow, which publishes the Linux x86_64 | |
| 28 | -compiler and `libclonim_runtime.a` as individual assets (plus `SHA256SUMS`). Put | |
| 29 | -the compiler and archive in the same directory. Generated programs statically | |
| 30 | -link the runtime and are standalone; users still need Nim installed as the | |
| 31 | -native-code backend. | |
| 27 | +matching `v*` trigger the release workflow, which packages both into a single | |
| 28 | +Linux x86_64 AppImage. Generated programs statically link the runtime and are | |
| 29 | +standalone; users still need Nim installed as the native-code backend. | |
| 32 | 30 | |
| 33 | 31 | Source-level libraries are loaded explicitly. Use |
| 34 | 32 | `(require '[clonim.core :refer [now-ms]])` to load `stdlib/clonim/core.clj`. Host-dependent operations remain small runtime primitives; for |
| @@ -24,11 +24,9 @@ and a clean working tree. Use `just bench-store 15` to change the threshold; | |||
| 24 | see [benchmark history](bench/README.md) for metrics and exit codes. | 24 | see [benchmark history](bench/README.md) for metrics and exit codes. |
| 25 | 25 | ||
| 26 | `just release` builds the compiler and its private static runtime. Version tags | 26 | `just release` builds the compiler and its private static runtime. Version tags |
| 27 | -matching `v*` trigger the release workflow, which publishes the Linux x86_64 | 27 | +matching `v*` trigger the release workflow, which packages both into a single |
| 28 | -compiler and `libclonim_runtime.a` as individual assets (plus `SHA256SUMS`). Put | 28 | +Linux x86_64 AppImage. Generated programs statically link the runtime and are |
| 29 | -the compiler and archive in the same directory. Generated programs statically | 29 | +standalone; users still need Nim installed as the native-code backend. |
| 30 | -link the runtime and are standalone; users still need Nim installed as the | ||
| 31 | -native-code backend. | ||
| 32 | 30 | ||
| 33 | Source-level libraries are loaded explicitly. Use | 31 | Source-level libraries are loaded explicitly. Use |
| 34 | `(require '[clonim.core :refer [now-ms]])` to load `stdlib/clonim/core.clj`. Host-dependent operations remain small runtime primitives; for | 32 | `(require '[clonim.core :refer [now-ms]])` to load `stdlib/clonim/core.clj`. Host-dependent operations remain small runtime primitives; for |
added
packaging/appimage/clonim.desktop +8 -0 | new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +[Desktop Entry] | |
| 2 | +Type=Application | |
| 3 | +Name=clonim | |
| 4 | +Comment=Clojure compiler hosted on Nim | |
| 5 | +Exec=clonim | |
| 6 | +Icon=clonim | |
| 7 | +Terminal=true | |
| 8 | +Categories=Development; | |
| new file mode 100644 | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | +[Desktop Entry] | ||
| 2 | +Type=Application | ||
| 3 | +Name=clonim | ||
| 4 | +Comment=Clojure compiler hosted on Nim | ||
| 5 | +Exec=clonim | ||
| 6 | +Icon=clonim | ||
| 7 | +Terminal=true | ||
| 8 | +Categories=Development; | ||
added
packaging/appimage/clonim.svg +5 -0 | new file mode 100644 | ||
| @@ -0,0 +1,5 @@ | ||
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"> | |
| 2 | + <rect width="128" height="128" rx="24" fill="#171717"/> | |
| 3 | + <path d="M84 37a36 36 0 1 0 0 54" fill="none" stroke="#79c267" stroke-width="14" stroke-linecap="round"/> | |
| 4 | + <path d="M72 48h31M72 64h25M72 80h31" fill="none" stroke="#ddd" stroke-width="8" stroke-linecap="round"/> | |
| 5 | +</svg> | |
| new file mode 100644 | |||
| @@ -0,0 +1,5 @@ | |||
| 1 | +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"> | ||
| 2 | + <rect width="128" height="128" rx="24" fill="#171717"/> | ||
| 3 | + <path d="M84 37a36 36 0 1 0 0 54" fill="none" stroke="#79c267" stroke-width="14" stroke-linecap="round"/> | ||
| 4 | + <path d="M72 48h31M72 64h25M72 80h31" fill="none" stroke="#ddd" stroke-width="8" stroke-linecap="round"/> | ||
| 5 | +</svg> | ||