Merge pull request #383 from sidick/feat/hostsocket-import #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: AppImage | |
| # Builds a portable AppImage and uploads it as a workflow artifact on every | |
| # qualifying change, and attaches it to the GitHub Release when a v* tag is | |
| # pushed. The build runs on ubuntu-22.04 deliberately: an AppImage built | |
| # against an older glibc runs on newer systems but not vice versa, so this | |
| # pins the floor of supported distributions. | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| paths: | |
| - "src/**" | |
| - "vendor/**" | |
| - "assets/**" | |
| - "Cargo.lock" | |
| - "Cargo.toml" | |
| - "packaging/appimage/**" | |
| - "packaging/linux/**" | |
| - ".github/workflows/appimage.yml" | |
| pull_request: | |
| paths: | |
| - "packaging/appimage/**" | |
| - "packaging/linux/**" | |
| - ".github/workflows/appimage.yml" | |
| concurrency: | |
| group: appimage-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build AppImage | |
| runs-on: ubuntu-22.04 | |
| # Needed only by the release-attach step on v* tags. | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Install build dependencies | |
| # Development headers for the dynamically-linked runtime stack: | |
| # ALSA (cpal), udev (gilrs), X11/Wayland/xkb (winit), plus FUSE so the | |
| # AppImage runtime and linuxdeploy can mount themselves. | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y --no-install-recommends \ | |
| libasound2-dev libudev-dev \ | |
| libx11-dev libxcursor-dev libxrandr-dev libxi-dev \ | |
| libxkbcommon-dev libwayland-dev \ | |
| libfuse2 file | |
| - name: Build AppImage | |
| run: ./packaging/appimage/build-appimage.sh | |
| - name: Locate artifact | |
| id: artifact | |
| run: | | |
| echo "path=$(ls Copperline-*.AppImage | head -n1)" >> "$GITHUB_OUTPUT" | |
| echo "helper=$(ls Copperline-*-net-helper.tar.gz | head -n1)" >> "$GITHUB_OUTPUT" | |
| - name: Smoke test the AppImage | |
| # Boot the finished AppImage from an empty directory: the run must | |
| # find the bundled AROS ROM through the AppDir's | |
| # usr/share/copperline/aros lookup (romsearch.rs), not the source | |
| # tree's assets/aros fallback that a repo-root cwd would satisfy. | |
| # A capture run opens no window or audio device, so a clean exit | |
| # plus a non-empty PNG proves the packaged image actually runs | |
| # (libfuse2 for the AppImage runtime is installed above). | |
| run: | | |
| appimage="$PWD/${{ steps.artifact.outputs.path }}" | |
| # linuxdeploy marks the image executable; do not rely on that | |
| # staying true across tooling changes. | |
| chmod +x "$appimage" | |
| smoke="$RUNNER_TEMP/appimage-smoke" | |
| mkdir -p "$smoke" | |
| cd "$smoke" | |
| "$appimage" --noaudio --screenshot-after 10 smoke.png | |
| test -s smoke.png | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: copperline-appimage | |
| path: ${{ steps.artifact.outputs.path }} | |
| if-no-files-found: error | |
| - uses: actions/upload-artifact@v7 | |
| with: | |
| name: copperline-linux-net-helper | |
| path: ${{ steps.artifact.outputs.helper }} | |
| if-no-files-found: error | |
| - name: Attach to release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| ${{ steps.artifact.outputs.path }} | |
| ${{ steps.artifact.outputs.helper }} |