From 6044a2b9d570bc12bb02f82695086ffc9f95dee0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kov=C3=A1cs=20B=C3=A1lint=20Hunor?= Date: Mon, 5 Oct 2026 23:28:25 +0300 Subject: [PATCH] Add nightly Linux builds published as a rolling pre-release Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01LeKXJc3DnK3PzAqwgA72NY --- .github/README.md | 8 ++ .github/workflows/nightly-linux.yml | 119 ++++++++++++++++++++++++++++ docs/linux-port/packaging.md | 8 ++ 3 files changed, 135 insertions(+) create mode 100644 .github/workflows/nightly-linux.yml diff --git a/.github/README.md b/.github/README.md index a63e931ced55..91a9455c3d2d 100644 --- a/.github/README.md +++ b/.github/README.md @@ -32,6 +32,14 @@ cd LinuxFiles scripts/linux/install-local.sh ``` +### Nightly builds + +Every merge to `linux/main` publishes a tarball and AppImage to the rolling [nightly pre-release](https://github.com/MemerGamer/LinuxFiles/releases/tag/nightly). Run it with: + +```sh +curl -LO https://github.com/MemerGamer/LinuxFiles/releases/download/nightly/LinuxFiles-nightly-x86_64.AppImage && chmod +x LinuxFiles-nightly-x86_64.AppImage && ./LinuxFiles-nightly-x86_64.AppImage +``` + See [docs/linux-port/packaging.md](../docs/linux-port/packaging.md) for packaging details and [docs/linux-port/PLAN.md](../docs/linux-port/PLAN.md) for the roadmap. ## Reporting bugs diff --git a/.github/workflows/nightly-linux.yml b/.github/workflows/nightly-linux.yml new file mode 100644 index 000000000000..c205a87dd0f6 --- /dev/null +++ b/.github/workflows/nightly-linux.yml @@ -0,0 +1,119 @@ +# Copyright (c) Files Community +# Licensed under the MIT License. + +# Abstract: +# Builds the self-contained linux-x64 tarball and AppImage on every push to linux/main and publishes them to +# one rolling "nightly" GitHub pre-release with stable asset names. Pull requests targeting linux/main get the +# same build as workflow artifacts only (read-only token). The Flatpak is left to package-linux.yml. + +name: Nightly Linux + +on: + workflow_dispatch: + push: + branches: + - linux/main + pull_request: + branches: + - linux/main + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || 'nightly' }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + + build-linux-x64: + + runs-on: ubuntu-latest + + steps: + + - name: Checkout the repository + uses: actions/checkout@v6 + + - name: Setup .NET + uses: actions/setup-dotnet@v5 + with: + global-json-file: global.json + + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }} + restore-keys: | + ${{ runner.os }}-nuget- + + - name: Publish self-contained linux-x64 + run: scripts/linux/publish.sh --rid linux-x64 --tarball + + - name: Build AppImage + run: packaging/linux/appimage/build-appimage.sh + + - name: Stage assets with stable names + run: | + mkdir -p dist + cp artifacts/files-linux-x64.tar.gz dist/LinuxFiles-nightly-linux-x64.tar.gz + cp artifacts/Files-x86_64.AppImage dist/LinuxFiles-nightly-x86_64.AppImage + + - name: Upload packages + uses: actions/upload-artifact@v4 + with: + name: linuxfiles-nightly-linux-x64 + path: dist/* + if-no-files-found: error + + publish-nightly: + + if: github.event_name != 'pull_request' && github.ref == 'refs/heads/linux/main' + needs: build-linux-x64 + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + + - name: Checkout the repository + uses: actions/checkout@v6 + with: + fetch-depth: 0 + + - name: Download packages + uses: actions/download-artifact@v4 + with: + name: linuxfiles-nightly-linux-x64 + path: dist + + - name: Replace the nightly release + env: + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + SHA: ${{ github.sha }} + run: | + short="${SHA:0:7}" + + # Commit list since the previous nightly (falls back to the last 20 commits). + prev="$(gh api "repos/$REPO/git/ref/tags/nightly" --jq '.object.sha' 2>/dev/null || true)" + if [ -n "$prev" ] && git cat-file -e "$prev^{commit}" 2>/dev/null; then + range="$prev..$SHA" + else + range="-20 $SHA" + fi + { + echo "Rolling build of \`linux/main\` at $SHA. Replaced on every push; not for production use." + echo + echo "Run the AppImage: \`chmod +x LinuxFiles-nightly-x86_64.AppImage && ./LinuxFiles-nightly-x86_64.AppImage\`" + echo + echo "### Changes since the previous nightly" + # shellcheck disable=SC2086 + git log --no-merges --format='- %h %s' $range + } > notes.md + + gh release delete nightly -R "$REPO" --cleanup-tag --yes 2>/dev/null || true + gh release create nightly -R "$REPO" --target "$SHA" --prerelease \ + --title "Nightly (linux/main @ $short)" --notes-file notes.md \ + dist/LinuxFiles-nightly-linux-x64.tar.gz dist/LinuxFiles-nightly-x86_64.AppImage diff --git a/docs/linux-port/packaging.md b/docs/linux-port/packaging.md index 2e487df4a2dc..6de867cd73ac 100644 --- a/docs/linux-port/packaging.md +++ b/docs/linux-port/packaging.md @@ -115,6 +115,14 @@ files, which is how the package was build-tested with `makepkg` here (resulting installed on the dev box, so the package is not linted. `aur/linuxfiles/PKGBUILD` (from source) is unchanged and unbuilt. +## Nightly builds + +`.github/workflows/nightly-linux.yml` builds the tarball and AppImage on every push to `linux/main` and replaces the +single rolling pre-release at https://github.com/MemerGamer/LinuxFiles/releases/tag/nightly (stable asset names +`LinuxFiles-nightly-linux-x64.tar.gz` and `LinuxFiles-nightly-x86_64.AppImage`; the Flatpak is only built for +`linux-v*` tags). Pull requests targeting `linux/main` get the same files as workflow artifacts with a read-only token. +Try it: `curl -LO https://github.com/MemerGamer/LinuxFiles/releases/download/nightly/LinuxFiles-nightly-x86_64.AppImage && chmod +x LinuxFiles-nightly-x86_64.AppImage && ./LinuxFiles-nightly-x86_64.AppImage` + ## Becoming the default file manager (Phase 6, not done yet) 1. `inode/directory`: already in the desktop entry's `MimeType=`. Users (or the installer's post-install hook)