diff --git a/.codacy.yaml b/.codacy.yaml new file mode 100644 index 0000000..8f9a950 --- /dev/null +++ b/.codacy.yaml @@ -0,0 +1,13 @@ +# Codacy (https://app.codacy.com): what it analyses. Rust lints (clippy, rustfmt) +# run in CI (.github/workflows/ci.yml) and block merges there; Codacy adds the +# overview, duplication, complexity, the other languages and test coverage. +exclude_paths: + # Generated from Cargo.lock (dev/third_party_licenses.py, checked in CI). + - "THIRD_PARTY_LICENSES.md" + - "crates/openrage-app/src/third_party_licenses.json" + # Name lists and lookup data, not code. + - "crates/rage-formats/src/meta_names.txt" + - "**/*.txt" + # Build output. + - "target/**" + - "plugins/target/**" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db4e68b..5864919 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,6 +71,44 @@ jobs: if: runner.os == 'Linux' - run: cargo test + # Test coverage (Linux), reported to Codacy. Runs the same tests as `test` + # with coverage instrumentation; the upload needs the CODACY_PROJECT_TOKEN + # secret, which pull requests from forks do not get, so it is skipped there. + # The upload action is pinned to the commit of its v1.3.0 tag. + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - name: Install system libraries for the GUI (Slint, audio output) + run: | + sudo apt-get update + sudo apt-get install -y libfontconfig1-dev libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev libudev-dev libasound2-dev + - uses: dtolnay/rust-toolchain@stable + # rust-toolchain.toml pins the version; add the coverage tools to it. + - run: rustup component add llvm-tools + - uses: taiki-e/install-action@v2 + with: + tool: cargo-llvm-cov@0.9.2 + - uses: Swatinem/rust-cache@v2 + with: + key: coverage + workspaces: | + . -> target + plugins -> target + - run: cargo llvm-cov --workspace --locked --lcov --output-path lcov.info + # The token only reaches the upload: the tests and the build scripts of + # the dependencies run without it. + - name: Is there a Codacy token? + id: codacy + env: + TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + run: echo "present=$([ -n "$TOKEN" ] && echo true || echo false)" >> "$GITHUB_OUTPUT" + - uses: codacy/codacy-coverage-reporter-action@89d6c85cfafaec52c72b6c5e8b2878d33104c699 # v1.3.0 + if: steps.codacy.outputs.present == 'true' + with: + project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} + coverage-reports: lcov.info + # Every dependency must come under a GPL-3-compatible licence (deny.toml), # and the generated licence list (THIRD_PARTY_LICENSES.md and the data the # app shows) must match Cargo.lock. diff --git a/.github/workflows/release-bundle.yml b/.github/workflows/release-bundle.yml index 0674474..f7e02d2 100644 --- a/.github/workflows/release-bundle.yml +++ b/.github/workflows/release-bundle.yml @@ -1,13 +1,14 @@ name: Release bundle -# One download with both the Linux and the Windows version, for mod sites -# that host a single file per release (GTA5-Mods, Nexus Mods, …). +# One download with every system's version, for mod sites that host a single +# file per release (GTA5-Mods, Nexus Mods, …). # # It runs after the Release workflow has published a tag's release: it takes -# that release's Linux .tar.gz and Windows .zip, unpacks them into `linux/` -# and `windows/` next to a short README and the license files, and attaches -# `openrage--linux-windows.zip` to the same release (its checksum is -# added to SHA256SUMS.txt). Nothing is built again. +# that release's Linux .tar.gz, Windows .zip and, if there is one, the macOS +# .tar.gz (a preview, so it may be missing), unpacks them into `linux/`, +# `windows/` and `macos/` next to a short README and the license files, and +# attaches `openrage--all-platforms.zip` to the same release (its +# checksum is added to SHA256SUMS.txt). Nothing is built again. # # "Run workflow" (manual) makes the bundle for an existing release tag; with # "upload" off it is only kept as a workflow artifact, to check it first. @@ -44,7 +45,7 @@ jobs: steps: # The default branch: it has the bundle README also for older tags. - uses: actions/checkout@v5 - - name: Download the Linux and Windows archives of the release + - name: Download the archives of the release run: | gh release view "$TAG" > /dev/null mkdir -p dl @@ -52,32 +53,43 @@ jobs: --pattern "openrage-${TAG}-linux-x86_64.tar.gz" \ --pattern "openrage-${TAG}-windows-x86_64.zip" \ --pattern SHA256SUMS.txt + # macOS is a preview build and may be missing from a release. + gh release download "$TAG" --dir dl --pattern "openrage-${TAG}-macos-arm64.tar.gz" || true (cd dl && sha256sum --check --ignore-missing SHA256SUMS.txt) - - name: Put both into one archive + - name: Put them into one archive run: | - bundle="openrage-${TAG}-linux-windows" + bundle="openrage-${TAG}-all-platforms" mkdir -p "$bundle" unpacked out tar xzf "dl/openrage-${TAG}-linux-x86_64.tar.gz" -C unpacked unzip -q "dl/openrage-${TAG}-windows-x86_64.zip" -d unpacked mv "unpacked/openrage-${TAG}-linux-x86_64" "$bundle/linux" mv "unpacked/openrage-${TAG}-windows-x86_64" "$bundle/windows" + systems="linux windows" + if [ -f "dl/openrage-${TAG}-macos-arm64.tar.gz" ]; then + tar xzf "dl/openrage-${TAG}-macos-arm64.tar.gz" -C unpacked + mv "unpacked/openrage-${TAG}-macos-arm64" "$bundle/macos" + systems="$systems macos" + fi # The license files and README once, at the top. for f in LICENSE LICENSE-AGPL-3.0 NOTICE.md README.md; do mv "$bundle/linux/$f" "$bundle/$f" - rm -f "$bundle/windows/$f" + for s in $systems; do rm -f "$bundle/$s/$f"; done done # Releases before 0.3 have no THIRD_PARTY_LICENSES.md. if [ -f "$bundle/linux/THIRD_PARTY_LICENSES.md" ]; then mv "$bundle/linux/THIRD_PARTY_LICENSES.md" "$bundle/THIRD_PARTY_LICENSES.md" - rm -f "$bundle/windows/THIRD_PARTY_LICENSES.md" + for s in $systems; do rm -f "$bundle/$s/THIRD_PARTY_LICENSES.md"; done fi # Every file the archives held, and nothing else, ends up in the bundle. - for f in "$bundle"/linux/* "$bundle"/windows/*; do test -s "$f"; done + for s in $systems; do for f in "$bundle/$s"/*; do test -s "$f"; done; done test -x "$bundle/linux/openrage-gui" && test -f "$bundle/windows/openrage-gui.exe" + if [ -d "$bundle/macos" ]; then test -x "$bundle/macos/openrage-gui"; fi sed "s/{VERSION}/${TAG}/" packaging/BUNDLE-README.txt > "$bundle/README.txt" + # Without a macOS build, leave its part out of the README. + if [ ! -d "$bundle/macos" ]; then sed -i '/^ macos\//,/^$/d' "$bundle/README.txt"; fi # Windows users open README.txt in Notepad: CRLF line ends. sed -i 's/$/\r/' "$bundle/README.txt" - # -X: no Unix owner fields; Unix permissions stay, so the Linux files remain executable. + # -X: no Unix owner fields; Unix permissions stay, so the Linux and macOS files remain executable. zip -q -r -X -9 "out/${bundle}.zip" "$bundle" (cd out && sha256sum "${bundle}.zip" | tee "${bundle}.zip.sha256") unzip -l "out/${bundle}.zip" @@ -89,7 +101,7 @@ jobs: - name: Attach the bundle to the release if: env.UPLOAD == 'true' run: | - bundle="openrage-${TAG}-linux-windows.zip" + bundle="openrage-${TAG}-all-platforms.zip" grep -v " ${bundle}\$" dl/SHA256SUMS.txt > SHA256SUMS.txt || true cat "out/${bundle}.sha256" >> SHA256SUMS.txt gh release upload "$TAG" "out/${bundle}" SHA256SUMS.txt --clobber diff --git a/README.md b/README.md index 38e1ba8..97db914 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ edit game text and install `.oiv` packages — compatible with OpenIV's `mods` f [![Website](https://img.shields.io/badge/website-two--play.github.io%2Fopenrage-c2410c.svg)](https://two-play.github.io/openrage/) [![CI](https://github.com/Two-Play/openrage/actions/workflows/ci.yml/badge.svg)](https://github.com/Two-Play/openrage/actions/workflows/ci.yml) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b51832dcb1464119ab0f48db6835ecbf)](https://app.codacy.com/gh/Two-Play/openrage/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) [![Dev environment](https://github.com/Two-Play/openrage/actions/workflows/dev-env.yml/badge.svg)](https://github.com/Two-Play/openrage/actions/workflows/dev-env.yml) [![License: GPL-3.0](https://img.shields.io/badge/license-GPL--3.0-blue.svg)](LICENSE) [![Rust 1.99](https://img.shields.io/badge/rust-1.99-orange.svg?logo=rust)](rust-toolchain.toml) diff --git a/packaging/BUNDLE-README.txt b/packaging/BUNDLE-README.txt index 5dabc45..cb1245d 100644 --- a/packaging/BUNDLE-README.txt +++ b/packaging/BUNDLE-README.txt @@ -1,11 +1,11 @@ -OpenRAGE {VERSION} - Linux and Windows -===================================== +OpenRAGE {VERSION} - Linux, Windows and macOS +============================================= OpenRAGE is a free, open-source explorer and mod tool for RAGE engine games (GTA V Legacy and Enhanced, GTA IV, Red Dead Redemption 2), the successor to OpenIV. It works with OpenIV's "mods" folder and .oiv packages. -This archive contains both versions: +This archive contains the version for each system: windows/ OpenRAGE for Windows 10/11 (x86_64) Start openrage-gui.exe. No installation needed. @@ -14,7 +14,11 @@ This archive contains both versions: Start ./openrage-gui. openrage.desktop and openrage.png add it to the application menu if you like. -Both folders also contain "openrage", the command-line tool, and "plugins" + macos/ OpenRAGE for macOS (Apple silicon), a preview + See README-macOS.txt: macOS blocks the unsigned programs + until you run "xattr -dr com.apple.quarantine ." there. + +Every folder also contains "openrage", the command-line tool, and "plugins" with three example plugins ("strings", "gxt2-patch" and "obj-tools"; MIT OR Apache-2.0). Plugins stay off until you turn them on in Settings > Plugins. diff --git a/site/config.toml b/site/config.toml index ab50f62..5dc5932 100644 --- a/site/config.toml +++ b/site/config.toml @@ -2,7 +2,7 @@ # Content lives in content/ (Markdown), layout in templates/, CSS/JS in static/. base_url = "https://two-play.github.io/openrage" title = "OpenRAGE" -description = "The free, open-source successor to OpenIV: mod GTA V and explore Red Dead Redemption 2 on Linux and Windows." +description = "The free, open-source successor to OpenIV: mod GTA V and explore Red Dead Redemption 2 on Linux, Windows and macOS." default_language = "en" compile_sass = false build_search_index = false diff --git a/site/content/_index.md b/site/content/_index.md index 03da5cc..276cf29 100644 --- a/site/content/_index.md +++ b/site/content/_index.md @@ -3,7 +3,7 @@ # TOML note: plain keys must stay above the first [table] / [[list]] entry. # Strings are Markdown (links, `code`, **bold**). Images are file names in docs/images/. title = "OpenRAGE – the open-source OpenIV successor" -description = "OpenRAGE is the free, open-source successor to OpenIV: mod GTA V (Legacy and Enhanced) and explore Red Dead Redemption 2 on Linux and Windows, with OpenIV's mods folder and .oiv packages, plus undo." +description = "OpenRAGE is the free, open-source successor to OpenIV: mod GTA V (Legacy and Enhanced) and explore Red Dead Redemption 2 on Linux, Windows and macOS, with OpenIV's mods folder and .oiv packages, plus undo." [extra] # Small line above the headline. @@ -11,7 +11,7 @@ eyebrow = "The open-source OpenIV successor" # **bold** parts are shown in the accent colour. headline = "The open modding toolkit for **RAGE engine** games" # One short line under the headline; the longer description belongs in features_intro. -lead = "OpenIV's last release was in 2022. OpenRAGE picks up where it left off: same `mods` folder and `.oiv` packages, now open source, on Linux and Windows, ready for GTA V Enhanced and RDR2." +lead = "OpenIV's last release was in 2022. OpenRAGE picks up where it left off: same `mods` folder and `.oiv` packages, now open source, on Linux, Windows and macOS, ready for GTA V Enhanced and RDR2." notice = """ OpenRAGE is an independent community project. It is not affiliated with or endorsed by Rockstar Games or Take-Two Interactive. It is not made by or affiliated with the OpenIV team either. @@ -200,8 +200,8 @@ text = "GPL-3.0: read, check and improve the code." [[extra.reasons]] icon = "🐧" -title = "Linux and Windows" -text = "Native on both, Steam and Proton installs included." +title = "Linux, Windows and macOS" +text = "Native on Linux and Windows, Steam and Proton installs included; macOS as a preview." [[extra.reasons]] icon = "🛠️" @@ -239,7 +239,7 @@ edge = "openrage" [[extra.compare]] feature = "Operating systems" openiv = "Windows" -openrage = "Linux and Windows" +openrage = "Linux, Windows and macOS (preview)" edge = "openrage" [[extra.compare]] diff --git a/site/content/development.md b/site/content/development.md index b38f5c5..0f3d288 100644 --- a/site/content/development.md +++ b/site/content/development.md @@ -96,10 +96,11 @@ A release: open a pull request from `develop` into `main`, merge it, then tag `m ## Releases -Releases are made by pushing a version tag on `main` (`git tag v0.2.0 && git push origin v0.2.0`, matching the version in `Cargo.toml`); the *Release* workflow builds both systems and publishes the release. It can also be run by hand from the Actions tab to build the archives without publishing. +Releases are made by pushing a version tag on `main` (`git tag v0.2.0 && git push origin v0.2.0`, matching the version in `Cargo.toml`); the *Release* workflow builds Linux, Windows and macOS (a preview: a failed macOS build does not stop the release) and publishes the release. It can also be run by hand from the Actions tab to build the archives without publishing. -Once a release is published, the *Release bundle* workflow adds `openrage--linux-windows.zip`: both versions in one -download (`linux/`, `windows/`, a short `README.txt` and the license files), for mod sites that host one file per release. +Once a release is published, the *Release bundle* workflow adds `openrage--all-platforms.zip`: every system's version +in one download (`linux/`, `windows/`, `macos/` if the release has a macOS build, a short `README.txt` and the license +files), for mod sites that host one file per release. It reuses the release's archives instead of building again and adds its checksum to `SHA256SUMS.txt`. Run it by hand (*Actions → Release bundle → Run workflow*) with a tag to make the bundle for an older release; with *upload* off it is only kept as a workflow artifact. diff --git a/site/content/gta-vi.md b/site/content/gta-vi.md index 2947976..e2c1e05 100644 --- a/site/content/gta-vi.md +++ b/site/content/gta-vi.md @@ -7,7 +7,7 @@ template = "gta-vi.html" # **bold** parts are shown in the accent colour. eyebrow = "Read-only preview" headline = "Explore **GTA VI**" -lead = "Open RPF9 archives like folders, search the whole game and look at what is inside, on Linux and Windows." +lead = "Open RPF9 archives like folders, search the whole game and look at what is inside, on Linux, Windows and macOS." features_title = "What you can do" features_intro = "Everything is read from your own copy of the game. Nothing in it is changed." screenshots_title = "Screenshots" diff --git a/site/content/plugins.md b/site/content/plugins.md index 198fa61..0e5d535 100644 --- a/site/content/plugins.md +++ b/site/content/plugins.md @@ -11,7 +11,7 @@ toc = true A plugin is a folder with a manifest (`plugin.toml`) and a WebAssembly component (`.wasm`). OpenRAGE runs it with [wasmtime](https://wasmtime.dev/). The plugin sees only the files the user hands it, plus the game's files if the user grants that (read-only). It has no access to other files, the network or the environment, and every call has a -memory and a time limit. The same `.wasm` runs on Linux and Windows. +memory and a time limit. The same `.wasm` runs on Linux, Windows and macOS. > [!NOTE] > The plugin API is at version **0.3** and may still change: plugins name the version they were built for and