diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 000e26544c..47def37524 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -475,7 +475,7 @@ jobs: cache-key: flatpak-devel-${{ matrix.arch }}-${{ hashFiles('Cargo.lock') }} # The image is built on the linter's own. Only the findings in # lint-exceptions.json may remain. The repository is not linted: its - # screenshot checks need images mirrored from the release tag. + # screenshot checks need the mirror only Flathub's build makes. - name: Lint the manifest if: ${{ !cancelled() && matrix.arch == 'x86_64' }} run: | diff --git a/linux/.gitattributes b/linux/.gitattributes new file mode 100644 index 0000000000..ad64fb20b9 --- /dev/null +++ b/linux/.gitattributes @@ -0,0 +1 @@ +build-aux/source-commit export-subst diff --git a/linux/README.md b/linux/README.md index 6ad1a5db38..7a6c45eca7 100644 --- a/linux/README.md +++ b/linux/README.md @@ -285,8 +285,12 @@ for the review and migration checks. ### Screenshots -The metainfo lists the PNGs in `data/screenshots` at the release tag's -URL, so a catalogue fetches the ones of the version it lists. +The metainfo lists the PNGs in `data/screenshots` at the URL of the +commit a release tarball holds, so a catalogue fetches the ones of the +version it lists. `git archive` writes that commit into +`build-aux/source-commit`; a release is built before its tag exists, and +`appstreamcli compose` drops a screenshot it cannot download. A build +from a git checkout names the release tag instead. Take new ones from the app at default settings (light style, blue accent, Adwaita Sans and Adwaita Mono at 11 pt, scale 1) with a 1000×700 window, diff --git a/linux/build-aux/packaging/flatpak-test-site.sh b/linux/build-aux/packaging/flatpak-test-site.sh index 9d3b7517df..f94d2a981d 100755 --- a/linux/build-aux/packaging/flatpak-test-site.sh +++ b/linux/build-aux/packaging/flatpak-test-site.sh @@ -7,7 +7,7 @@ # second, so an installed app has an update to take, and # /bundles/ the bundles of the first commit. It also # validates the desktop entry, the metainfo and the schema each app commit -# installs. +# installs, and checks that its catalogue lists every screenshot. # # --install-deps first installs, as root in a throwaway Ubuntu, the tools # this needs. @@ -65,6 +65,13 @@ for ref in $(ostree refs --repo="$work/repo" | grep "^app/$app/"); do desktop-file-validate "$tree/files/share/applications/$app.desktop" appstreamcli validate --no-net "$tree/files/share/metainfo/$app.metainfo.xml" glib-compile-schemas --strict --dry-run "$tree/files/share/glib-2.0/schemas" + # appstreamcli compose drops a screenshot it cannot download. + named="$(grep -c ']' "$tree/files/share/metainfo/$app.metainfo.xml")" + listed="$(gzip -dc "$tree/files/share/app-info/xmls/$app.xml.gz" | grep -c ']' || true)" + if [ "$listed" -ne "$named" ]; then + echo "flatpak-test-site.sh: the catalogue of $ref lists $listed of the metainfo's $named screenshots" >&2 + exit 1 + fi done commit "$@" diff --git a/linux/build-aux/source-commit b/linux/build-aux/source-commit new file mode 100644 index 0000000000..6828f88dcb --- /dev/null +++ b/linux/build-aux/source-commit @@ -0,0 +1 @@ +$Format:%H$ diff --git a/linux/changelog.d/4152.changed.md b/linux/changelog.d/4152.changed.md new file mode 100644 index 0000000000..0e79ec8912 --- /dev/null +++ b/linux/changelog.d/4152.changed.md @@ -0,0 +1 @@ +The software center listing says TablePro works without an account or a license, and when it asks you to buy one. diff --git a/linux/changelog.d/4152.fixed.md b/linux/changelog.d/4152.fixed.md new file mode 100644 index 0000000000..aa65f8d760 --- /dev/null +++ b/linux/changelog.d/4152.fixed.md @@ -0,0 +1 @@ +Software centers showed no screenshots for TablePro from the TablePro Flatpak repository. diff --git a/linux/crates/app/build.rs b/linux/crates/app/build.rs index 70d78b0316..3ad9573e36 100644 --- a/linux/crates/app/build.rs +++ b/linux/crates/app/build.rs @@ -7,6 +7,7 @@ use std::process::ExitCode; mod metainfo_release; const METAINFO_TEMPLATE: &str = "../../data/app.tablepro.TablePro.metainfo.xml.in.in"; +const SOURCE_COMMIT: &str = "../../build-aux/source-commit"; /// The fallback `config::APP_ID` takes when Meson sets nothing. const DEFAULT_APP_ID: &str = "app.tablepro.TablePro.Devel"; @@ -67,17 +68,24 @@ fn render_metainfo() -> Result { fn render_template() -> Result { println!("cargo::rerun-if-changed={METAINFO_TEMPLATE}"); + println!("cargo::rerun-if-changed={SOURCE_COMMIT}"); println!("cargo::rerun-if-env-changed=TABLEPRO_APP_ID"); let app_id = env::var("TABLEPRO_APP_ID").unwrap_or_else(|_| DEFAULT_APP_ID.to_owned()); let package = env::var("CARGO_PKG_NAME").map_err(|error| format!("CARGO_PKG_NAME: {error}"))?; let template = fs::read_to_string(METAINFO_TEMPLATE) .map_err(|error| format!("could not read {METAINFO_TEMPLATE}: {error}"))?; + let source_commit = + fs::read_to_string(SOURCE_COMMIT).map_err(|error| format!("could not read {SOURCE_COMMIT}: {error}"))?; let version = metainfo_release::newest_release(&template) .ok_or_else(|| format!("{METAINFO_TEMPLATE} lists no release with a version"))?; let rendered = template .replace("@app-id@", &app_id) .replace("@gettext-package@", &package) - .replace("@version@", &metainfo_release::tag_version(version)); + .replace("@version@", &metainfo_release::tag_version(version)) + .replace( + "@screenshots-ref@", + &metainfo_release::screenshots_ref(&source_commit, version), + ); if let Some(name) = unfilled_placeholder(&rendered) { return Err(format!( "{METAINFO_TEMPLATE} uses @{name}@, which build.rs does not fill" diff --git a/linux/crates/app/src/application/about_dialog.rs b/linux/crates/app/src/application/about_dialog.rs index 465f87251b..292efe1c31 100644 --- a/linux/crates/app/src/application/about_dialog.rs +++ b/linux/crates/app/src/application/about_dialog.rs @@ -67,7 +67,7 @@ mod tests { use gtk4 as gtk; use super::*; - use crate::application::metainfo_release::{newest_release, tag_version}; + use crate::application::metainfo_release::{newest_release, screenshots_ref, tag_version}; /// The text between the element `open` starts and the next `close`. fn metainfo_text<'a>(xml: &'a str, open: &str, close: &str) -> &'a str { @@ -124,10 +124,17 @@ mod tests { #[test] fn embedded_metainfo_pins_project_links_to_the_release_tag() { let xml = embedded_metainfo(); - let version = tag_version(newest_release(&xml).expect("the metainfo lists a release")); + let release = newest_release(&xml).expect("the metainfo lists a release"); + let version = tag_version(release); let tree = format!("https://github.com/TableProApp/TablePro/blob/linux-v{version}/linux"); - let screenshots = - format!("https://raw.githubusercontent.com/TableProApp/TablePro/linux-v{version}/linux/data/screenshots/"); + let source_commit = std::fs::read_to_string( + std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("../../build-aux/source-commit"), + ) + .expect("build-aux/source-commit is in the source tree"); + let screenshots = format!( + "https://raw.githubusercontent.com/TableProApp/TablePro/{}/linux/data/screenshots/", + screenshots_ref(&source_commit, release) + ); let releases = metainfo_text(&xml, ""); assert_eq!( diff --git a/linux/crates/app/src/application/metainfo_release.rs b/linux/crates/app/src/application/metainfo_release.rs index 5985b87d36..e5abc5ae24 100644 --- a/linux/crates/app/src/application/metainfo_release.rs +++ b/linux/crates/app/src/application/metainfo_release.rs @@ -16,6 +16,15 @@ pub(crate) fn tag_version(release: &str) -> String { release.replacen('~', "-", 1) } +// git archive writes the commit into build-aux/source-commit (export-subst), and a release +// is built before its tag exists; a git checkout keeps the `$Format:%H$` placeholder. +pub(crate) fn screenshots_ref(source_commit: &str, release: &str) -> String { + match source_commit.trim() { + placeholder if placeholder.starts_with('$') => format!("linux-v{}", tag_version(release)), + commit => commit.to_owned(), + } +} + fn attribute<'a>(attributes: &'a str, name: &str) -> Option<&'a str> { let mut rest = attributes; loop { @@ -67,6 +76,13 @@ mod tests { assert_eq!(tag_version("0.1.0"), "0.1.0"); } + #[test] + fn screenshots_name_the_archived_commit_or_the_tag() { + let commit = "3723a6c4cd9e17e1c8c641127b4d37c4f759e625"; + assert_eq!(screenshots_ref(&format!("{commit}\n"), "0.1.0~beta.3"), commit); + assert_eq!(screenshots_ref("$Format:%H$\n", "0.1.0~beta.3"), "linux-v0.1.0-beta.3"); + } + #[test] fn a_release_without_a_version_names_none() { assert_eq!(newest_release(""), None); diff --git a/linux/data/app.tablepro.TablePro.metainfo.xml.in.in b/linux/data/app.tablepro.TablePro.metainfo.xml.in.in index bb59e1ed56..2ac87b2176 100644 --- a/linux/data/app.tablepro.TablePro.metainfo.xml.in.in +++ b/linux/data/app.tablepro.TablePro.metainfo.xml.in.in @@ -1,4 +1,5 @@ + @app-id@ CC0-1.0 @@ -21,6 +22,12 @@
  • Verify TLS, keep connections read-only, and reconnect on drop
  • Export results to CSV, JSON, SQL, Excel, Markdown, HTML and XML
  • +

    + TablePro works fully without an account or a license. A license covers 3 + devices at a time, Mac or Linux. From the 30th day you use TablePro + without one, a message in the window asks you to buy one, at most once + every 90 days. +

    @app-id@.desktop @@ -39,19 +46,19 @@ - https://raw.githubusercontent.com/TableProApp/TablePro/linux-v@version@/linux/data/screenshots/01-table.png + https://raw.githubusercontent.com/TableProApp/TablePro/@screenshots-ref@/linux/data/screenshots/01-table.png Browse and edit table rows - https://raw.githubusercontent.com/TableProApp/TablePro/linux-v@version@/linux/data/screenshots/02-editor.png + https://raw.githubusercontent.com/TableProApp/TablePro/@screenshots-ref@/linux/data/screenshots/02-editor.png Run SQL in the editor - https://raw.githubusercontent.com/TableProApp/TablePro/linux-v@version@/linux/data/screenshots/03-structure.png + https://raw.githubusercontent.com/TableProApp/TablePro/@screenshots-ref@/linux/data/screenshots/03-structure.png Change a table's columns and indexes - https://raw.githubusercontent.com/TableProApp/TablePro/linux-v@version@/linux/data/screenshots/04-connect.png + https://raw.githubusercontent.com/TableProApp/TablePro/@screenshots-ref@/linux/data/screenshots/04-connect.png Connect through an SSH tunnel @@ -80,8 +87,8 @@ - + moderate mild diff --git a/linux/data/meson.build b/linux/data/meson.build index fa07f7bff1..4566c4488a 100644 --- a/linux/data/meson.build +++ b/linux/data/meson.build @@ -4,6 +4,17 @@ substitutions.set('bindir', bindir) substitutions.set('gettext-package', meson.project_name()) substitutions.set('version', meson.project_version()) +# git archive writes the commit into source-commit (export-subst), and a +# release is built before its tag exists: appstreamcli compose drops a +# screenshot whose URL names the tag. A git checkout keeps the tag's URL. +fs = import('fs') +source_commit = fs.read(meson.project_source_root() / 'build-aux' / 'source-commit').strip() +if source_commit.startswith('$') + substitutions.set('screenshots-ref', 'linux-v' + meson.project_version()) +else + substitutions.set('screenshots-ref', source_commit) +endif + desktop_file_in = configure_file( input: 'app.tablepro.TablePro.desktop.in.in', output: application_id + '.desktop.in', diff --git a/linux/docs/releasing.md b/linux/docs/releasing.md index 2ef5dd0bd5..ddc6ec15bc 100644 --- a/linux/docs/releasing.md +++ b/linux/docs/releasing.md @@ -164,6 +164,13 @@ If the notice offers an earlier tested version, link its exact release and packa [ADR 0041, Context](decisions/0041-beta-repositories-and-release-packages.md#context) amends the older permission-policy history in ADRs 0008 and 0018. Passing the linter is not permission approval. A maintainer writes the manifest and submission by hand, discloses AI-assisted material as required, and obtains Flathub's permission review under its [current requirements](https://docs.flathub.org/docs/for-app-authors/requirements). A new app enters stable before it can use Flathub beta. +The app's own files also need a maintainer before the submission: + +- **Translations.** The AI disclosure names each catalogue in `po/LINGUAS` that an agent translated (Requirements, Generative AI policy). The Localisation policy's bar on machine-generated translations is about the English localisation. +- **Screenshots.** Retake any whose window changed since `data/screenshots` was taken (MetaInfo guidelines, Quality guidelines, Screenshots, Up to date; [README.md](../README.md#screenshots)). +- **Licensing.** The metainfo description's last paragraph states what a license gives and when the app asks for one. A change to either changes it in the same release (Requirements, Monetisation policy). +- **Verification.** Flathub verifies the app through `tablepro.app` once it is listed (Quality guidelines, Managed by app author). + Our existing installs keep their TablePro origin. Adding Flathub or changing the default branch does not migrate that origin. Before offering migration instructions, test an explicit origin change from both our stable and beta installs to the accepted Flathub app. Record the commands and before/after origin, branch and commit from `flatpak info`. Verify updates come from Flathub, secrets still load, saved work survives and rollback works. Keep our repository available until that tested migration is published. Do not promise automatic migration. ## The first release diff --git a/linux/po/vi.po b/linux/po/vi.po index 1af234e6d3..61196d3623 100644 --- a/linux/po/vi.po +++ b/linux/po/vi.po @@ -10259,6 +10259,17 @@ msgstr "" msgid "Export results to CSV, JSON, SQL, Excel, Markdown, HTML and XML" msgstr "Xuất kết quả sang CSV, JSON, SQL, Excel, Markdown, HTML và XML" +#: data/app.tablepro.TablePro.metainfo.xml.in.in +msgid "" +"TablePro works fully without an account or a license. A license covers 3 " +"devices at a time, Mac or Linux. From the 30th day you use TablePro without " +"one, a message in the window asks you to buy one, at most once every 90 days." +msgstr "" +"TablePro hoạt động đầy đủ mà không cần tài khoản hay giấy phép. Một giấy phép" +" dùng được trên 3 thiết bị cùng lúc, Mac hoặc Linux. Từ ngày thứ 30 bạn dùng " +"TablePro mà chưa có giấy phép, một thông báo trong cửa sổ sẽ đề nghị bạn mua," +" nhiều nhất 90 ngày một lần." + #: data/app.tablepro.TablePro.metainfo.xml.in.in msgid "Browse and edit table rows" msgstr "Duyệt và sửa các dòng của bảng"