diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml
index 3d4fffc..fd942b3 100644
--- a/.github/workflows/desktop.yml
+++ b/.github/workflows/desktop.yml
@@ -1,6 +1,8 @@
name: Desktop and CLI
on:
+ # Branches are checked by their pull request; main is checked after each merge.
push:
+ branches: [main]
paths-ignore:
- '**/*.md'
- 'docs/**'
diff --git a/.github/workflows/prepare-updates.yml b/.github/workflows/prepare-updates.yml
deleted file mode 100644
index 9ee93d5..0000000
--- a/.github/workflows/prepare-updates.yml
+++ /dev/null
@@ -1,223 +0,0 @@
-name: Release packages and signed updates (manual)
-run-name: ${{ inputs.source_run_id && format('Assemble existing signed packages (run {0})', inputs.source_run_id) || 'Build signed release packages' }}
-on:
- workflow_dispatch:
- inputs:
- source_run_id:
- description: Existing run with four verified platform builds (assembly only; leave empty for new builds)
- required: false
- type: string
-permissions:
- contents: read
-concurrency:
- group: maxrar-release-${{ github.ref }}
- cancel-in-progress: false
-env:
- CARGO_BUILD_JOBS: '2'
- CARGO_INCREMENTAL: '0'
- CARGO_PROFILE_DEV_DEBUG: '0'
- CARGO_PROFILE_TEST_DEBUG: '0'
-jobs:
- prepare:
- name: Check version tag and prepared draft
- runs-on: ubuntu-24.04
- permissions:
- contents: write
- actions: read
- outputs:
- run_id: ${{ steps.source.outputs.run_id }}
- steps:
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- - name: Require the version tag at this exact commit
- id: source
- env:
- GH_TOKEN: ${{ github.token }}
- SOURCE_RUN_ID: ${{ inputs.source_run_id }}
- run: |
- python3 scripts/check-release-config.py
- python3 scripts/check-release-tag.py --repository "$GITHUB_REPOSITORY" --commit "$GITHUB_SHA" --source-run "$SOURCE_RUN_ID" --current-run "$GITHUB_RUN_ID" --output "$GITHUB_OUTPUT"
- stage:
- if: ${{ inputs.source_run_id == '' }}
- name: Signed release - ${{ matrix.label }}
- needs: prepare
- strategy:
- fail-fast: false
- matrix:
- include:
- - os: windows-latest
- label: Windows (x64)
- artifact: windows-x64
- target: windows-x86_64
- rust_target: x86_64-pc-windows-msvc
- bundles: nsis
- extra_config: --config src-tauri/tauri.explorer-menu.json --config src-tauri/release-signing.json
- - os: macos-15-intel
- label: macOS - Intel (x64)
- artifact: macos-intel
- target: darwin-x86_64
- rust_target: x86_64-apple-darwin
- bundles: app,dmg
- - os: macos-15
- label: macOS - Apple Silicon (M-series)
- artifact: macos-apple-silicon
- target: darwin-aarch64
- rust_target: aarch64-apple-darwin
- bundles: app,dmg
- - os: ubuntu-24.04
- label: Linux (x64)
- artifact: linux-x64
- target: linux-x86_64
- rust_target: x86_64-unknown-linux-gnu
- bundles: appimage,deb,rpm
- runs-on: ${{ matrix.os }}
- env:
- TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
- TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- APPIMAGE_EXTRACT_AND_RUN: '1'
- steps:
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
- with:
- node-version: '22'
- cache: npm
- - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
- with:
- python-version: '3.12'
- - name: Require complete updater configuration
- run: python scripts/check-release-config.py --require-secrets
- - uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249
- with:
- toolchain: '1.95.0'
- targets: ${{ matrix.rust_target }}
- components: rustfmt, clippy
- - name: Linux build dependencies
- if: runner.os == 'Linux'
- run: sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev libfuse2
- - run: npm ci
- - run: npm run check
- - run: npm test
- - run: python -m unittest discover -s verification -p 'test_release*.py'
- - run: cargo fmt --all -- --check
- - run: cargo test --locked --workspace
- - run: cargo clippy --locked --workspace --all-targets -- -D warnings
- - name: Free checked debug artifacts before packaging
- run: cargo clean --profile dev
- - name: Install the Windows signing tool
- if: runner.os == 'Windows'
- run: cargo install trusted-signing-cli --locked
- - name: Build and sign the Windows 11 Explorer menu package
- if: runner.os == 'Windows'
- shell: pwsh
- env:
- AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
- AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
- AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
- run: ./scripts/build-explorer-menu.ps1 -Target ${{ matrix.rust_target }} -Sign
- - name: Apple signing and notarization
- if: runner.os == 'macOS'
- env:
- APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
- APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
- APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
- APPLE_ID: ${{ secrets.APPLE_ID }}
- APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
- APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- run: |
- if [ -z "$APPLE_CERTIFICATE" ]; then
- echo "::error::Apple signing secrets are missing; refusing to publish an unsigned Mac release."
- exit 1
- fi
- cert=$(printf '%s' "$APPLE_CERTIFICATE" | tr -d ' \r\n')
- echo "::add-mask::$cert"
- echo "APPLE_CERTIFICATE=$cert" >> "$GITHUB_ENV"
- for v in APPLE_CERTIFICATE_PASSWORD APPLE_SIGNING_IDENTITY APPLE_ID APPLE_PASSWORD APPLE_TEAM_ID; do
- printf '%s=%s\n' "$v" "$(printf '%s' "${!v}" | tr -d '\r\n')" >> "$GITHUB_ENV"
- done
- - name: Build signed updater artifacts and initial installers
- env:
- AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
- AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
- AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
- run: npm run tauri -- build --config src-tauri/tauri.updater.conf.json ${{ matrix.extra_config }} --bundles ${{ matrix.bundles }} --target ${{ matrix.rust_target }}
- - name: Check Windows publisher signatures
- if: runner.os == 'Windows'
- shell: pwsh
- run: |
- $setup = (Get-ChildItem 'target/${{ matrix.rust_target }}/release/bundle/nsis/*.exe').FullName
- if (@($setup).Count -ne 1) { throw "Expected one NSIS installer; found $(@($setup).Count)" }
- # Check the files users actually install: unpack the installer and verify what is inside.
- $unpacked = Join-Path $env:RUNNER_TEMP 'signed-installer'
- & "$env:ProgramFiles\7-Zip\7z.exe" x -y "-o$unpacked" $setup | Out-Null
- if ($LASTEXITCODE) { throw "Could not unpack $setup" }
- $inside = foreach ($name in 'maxrar.exe', 'maxrar_shell.dll') {
- $found = @(Get-ChildItem $unpacked -Recurse -File -Filter $name)
- if ($found.Count -eq 0) { throw "$name is missing from the installer" }
- $found.FullName
- }
- foreach ($f in @($setup) + $inside + 'target/explorer-menu/maxrar_shell.dll' + 'target/explorer-menu/maxrar-explorer-menu.msix') {
- $sig = Get-AuthenticodeSignature -LiteralPath $f
- if ($sig.Status -ne 'Valid') { throw "$f signature: $($sig.Status)" }
- Write-Output "$([IO.Path]::GetFileName($f)): $($sig.SignerCertificate.Subject)"
- }
- - name: Check Mac signature and notarization
- if: runner.os == 'macOS'
- run: |
- app=$(find target/${{ matrix.rust_target }}/release/bundle/macos -maxdepth 1 -name '*.app' | head -1)
- codesign --verify --deep --strict --verbose=2 "$app"
- spctl --assess --type execute --verbose=2 "$app"
- xcrun stapler validate "$app"
- - name: Check Windows Explorer integration
- if: runner.os == 'Windows'
- shell: pwsh
- run: ./scripts/test-windows-shell.ps1 -BundleRoot 'target/${{ matrix.rust_target }}/release/bundle'
- - name: Stage assets and platform manifest
- shell: bash
- run: |
- release_version=$(node -p "require('./src-tauri/tauri.conf.json').version")
- python scripts/stage-update.py --root target/${{ matrix.rust_target }}/release/bundle --platform '${{ matrix.target }}' --version "$release_version"
- cp LICENSE NOTICE THIRD-PARTY-NOTICES.md release-stage/
- - name: Verify signed packages and reject tampered content
- run: cargo run --locked --release -p wonrar-desktop --example verify-updates --target ${{ matrix.rust_target }} -- release-stage
- - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
- with:
- name: maxrar-signed-${{ matrix.artifact }}
- path: release-stage/
- if-no-files-found: error
- assemble:
- name: Complete feed and upload to draft
- needs: [prepare, stage]
- if: ${{ !cancelled() && needs.prepare.result == 'success' && (needs.stage.result == 'success' || (needs.stage.result == 'skipped' && inputs.source_run_id != '')) }}
- runs-on: ubuntu-24.04
- permissions:
- contents: write
- actions: read
- steps:
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
- with:
- pattern: maxrar-signed-*
- path: signed-platforms
- run-id: ${{ needs.prepare.outputs.run_id }}
- github-token: ${{ github.token }}
- - name: Assemble complete release
- run: |
- release_version=$(python3 -c "import json;print(json.load(open('src-tauri/tauri.conf.json'))['version'])")
- python3 scripts/check-release-config.py
- python3 scripts/assemble-release.py --source signed-platforms --output release-stage --notes "docs/releases/v${release_version}.md"
- - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
- with:
- name: maxrar-complete-release
- path: release-stage/
- if-no-files-found: error
- overwrite: true
- - name: Attach verified packages to the prepared draft
- env:
- GH_TOKEN: ${{ github.token }}
- run: |
- release_version=$(python3 -c "import json;print(json.load(open('src-tauri/tauri.conf.json'))['version'])")
- existing=$(gh release view "v${release_version}" --repo "$GITHUB_REPOSITORY" --json isDraft --jq .isDraft)
- if [ "$existing" != true ]; then
- echo "The prepared draft is missing or already published; refusing to replace its assets."
- exit 1
- fi
- gh release upload "v${release_version}" release-stage/* --repo "$GITHUB_REPOSITORY" --clobber
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..133c2a0
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,224 @@
+name: Release
+
+# Push a version tag (git tag -a v0.1.2 -m "MaxRAR v0.1.2" && git push origin v0.1.2).
+# The tag must match the app version and have notes in docs/releases/.md.
+on:
+ push:
+ tags:
+ - "v*"
+
+permissions:
+ contents: write
+
+jobs:
+ release:
+ name: Check tag and prepare release
+ runs-on: ubuntu-24.04
+ outputs:
+ id: ${{ steps.release.outputs.id }}
+ steps:
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
+
+ - name: Check the tag matches the app version
+ run: |
+ version=$(python3 -c "import json; print(json.load(open('src-tauri/tauri.conf.json'))['version'])")
+ if [ "$GITHUB_REF_NAME" != "v$version" ]; then
+ echo "::error::Tag $GITHUB_REF_NAME does not match app version $version"
+ exit 1
+ fi
+ test -f "docs/releases/$GITHUB_REF_NAME.md" || { echo "::error::Missing docs/releases/$GITHUB_REF_NAME.md"; exit 1; }
+ python3 scripts/check-release-config.py
+
+ # Reuses a draft if one exists, so assets never land in two places.
+ - name: Create the draft release
+ id: release
+ env:
+ GH_TOKEN: ${{ github.token }}
+ run: |
+ find_id() {
+ gh api "repos/$GITHUB_REPOSITORY/releases" --paginate --jq ".[] | select(.tag_name == \"$GITHUB_REF_NAME\") | .id" | head -1
+ }
+ id=$(find_id)
+ if [ -z "$id" ]; then
+ gh release create "$GITHUB_REF_NAME" --draft --verify-tag --title "MaxRAR $GITHUB_REF_NAME" --notes-file "docs/releases/$GITHUB_REF_NAME.md"
+ id=$(find_id)
+ fi
+ echo "id=$id" >> "$GITHUB_OUTPUT"
+
+ build:
+ name: Build - ${{ matrix.label }}
+ needs: release
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ # Signed with Azure Artifact Signing (account matily-signing, profile matily-public).
+ - platform: windows-latest
+ label: Windows (x64)
+ args: --bundles nsis --config src-tauri/tauri.updater.conf.json --config src-tauri/tauri.explorer-menu.json --config src-tauri/release-signing.json
+ - platform: macos-15
+ label: macOS - Apple Silicon
+ target: aarch64-apple-darwin
+ args: --bundles app,dmg --target aarch64-apple-darwin --config src-tauri/tauri.updater.conf.json
+ - platform: macos-15-intel
+ label: macOS - Intel
+ target: x86_64-apple-darwin
+ args: --bundles app,dmg --target x86_64-apple-darwin --config src-tauri/tauri.updater.conf.json
+ - platform: ubuntu-24.04
+ label: Linux (x64)
+ args: --bundles appimage,deb,rpm --config src-tauri/tauri.updater.conf.json
+ runs-on: ${{ matrix.platform }}
+ steps:
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
+
+ - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
+ with:
+ node-version: '22'
+ cache: npm
+
+ - uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249
+ with:
+ toolchain: '1.95.0'
+ targets: ${{ matrix.target }}
+
+ - uses: swatinem/rust-cache@v2
+
+ - name: Linux build dependencies
+ if: runner.os == 'Linux'
+ run: sudo apt-get update && sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf libssl-dev libfuse2
+
+ - run: npm ci
+
+ - name: Install the Windows signing tool
+ if: runner.os == 'Windows'
+ run: cargo install trusted-signing-cli --locked
+
+ - name: Build and sign the Windows 11 Explorer menu package
+ if: runner.os == 'Windows'
+ shell: pwsh
+ env:
+ AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
+ AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
+ AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
+ run: ./scripts/build-explorer-menu.ps1 -Target x86_64-pc-windows-msvc -Sign
+
+ # Signs and notarizes the Mac build with the Developer ID certificate.
+ - name: Apple signing and notarization
+ if: runner.os == 'macOS'
+ env:
+ APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
+ APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
+ APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
+ APPLE_ID: ${{ secrets.APPLE_ID }}
+ APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
+ APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
+ run: |
+ if [ -z "$APPLE_CERTIFICATE" ]; then
+ echo "::error::Apple signing secrets are missing; refusing to release an unsigned Mac build."
+ exit 1
+ fi
+ # A pasted certificate may carry line breaks; base64 must not.
+ cert=$(printf '%s' "$APPLE_CERTIFICATE" | tr -d ' \r\n')
+ # No longer the stored secret, so GitHub would not hide it in logs.
+ echo "::add-mask::$cert"
+ echo "APPLE_CERTIFICATE=$cert" >> "$GITHUB_ENV"
+ for v in APPLE_CERTIFICATE_PASSWORD APPLE_SIGNING_IDENTITY APPLE_ID APPLE_PASSWORD APPLE_TEAM_ID; do
+ printf '%s=%s\n' "$v" "$(printf '%s' "${!v}" | tr -d '\r\n')" >> "$GITHUB_ENV"
+ done
+
+ # latest.json is written once, after all builds, so parallel jobs cannot overwrite it.
+ - uses: tauri-apps/tauri-action@v0
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
+ TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
+ AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }}
+ AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }}
+ AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }}
+ with:
+ releaseId: ${{ needs.release.outputs.id }}
+ includeUpdaterJson: false
+ args: ${{ matrix.args }}
+
+ publish:
+ name: Publish release and update README
+ needs: [release, build]
+ runs-on: ubuntu-24.04
+ env:
+ GH_TOKEN: ${{ github.token }}
+ TAG: ${{ github.ref_name }}
+ steps:
+ - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
+ with:
+ ref: main
+
+ - name: Name the Mac installers for each chip
+ run: |
+ version="${TAG#v}"
+ assets="repos/$GITHUB_REPOSITORY/releases/${{ needs.release.outputs.id }}/assets"
+ gh api "$assets" --paginate --jq '.[] | "\(.id) \(.name)"' > names.txt
+ while read -r id name; do
+ case "$name" in
+ *_aarch64.dmg) new="MaxRAR_${version}_macOS_apple-silicon.dmg" ;;
+ *_x64.dmg) new="MaxRAR_${version}_macOS_intel.dmg" ;;
+ *) continue ;;
+ esac
+ # A repeated run leaves the earlier attempt's renamed file behind; the new build replaces it.
+ stale=$(awk -v n="$new" '$2 == n { print $1 }' names.txt)
+ [ -z "$stale" ] || gh api -X DELETE "repos/$GITHUB_REPOSITORY/releases/assets/$stale"
+ gh api -X PATCH "repos/$GITHUB_REPOSITORY/releases/assets/$id" -f name="$new" > /dev/null
+ echo "$name -> $new"
+ done < names.txt
+
+ - name: Write the update feed and checksums
+ run: |
+ mkdir assets
+ gh release download "$TAG" -D assets
+ python3 - <<'EOF'
+ import datetime, glob, json, os
+ tag, repo = os.environ['TAG'], os.environ['GITHUB_REPOSITORY']
+ # The file each platform's in-app updater installs.
+ updates = {'windows-x86_64': '*_x64-setup.exe', 'darwin-aarch64': '*aarch64*.app.tar.gz',
+ 'darwin-x86_64': '*x64*.app.tar.gz', 'linux-x86_64': '*.AppImage'}
+ platforms = {}
+ for platform, pattern in updates.items():
+ found = glob.glob(os.path.join('assets', pattern))
+ if len(found) != 1:
+ raise SystemExit(f'{platform}: expected one {pattern}, found {found}')
+ name = os.path.basename(found[0])
+ platforms[platform] = {'signature': open(found[0] + '.sig').read().strip(),
+ 'url': f'https://github.com/{repo}/releases/download/{tag}/{name}'}
+ feed = {'version': tag.removeprefix('v'), 'notes': open(f'docs/releases/{tag}.md').read(),
+ 'pub_date': datetime.datetime.now(datetime.timezone.utc).strftime('%Y-%m-%dT%H:%M:%SZ'),
+ 'platforms': platforms}
+ json.dump(feed, open('latest.json', 'w'), indent=2)
+ EOF
+ (cd assets && sha256sum -- * ../latest.json | sed 's#\.\./##') > SHA256SUMS.txt
+ cat SHA256SUMS.txt
+ gh release upload "$TAG" latest.json SHA256SUMS.txt --clobber
+
+ - name: Publish the release
+ run: gh release edit "$TAG" --draft=false --latest --title "MaxRAR $TAG" --notes-file "docs/releases/$TAG.md"
+
+ - name: Point README download links at the new release
+ run: |
+ version="${TAG#v}"
+ v='[0-9]+\.[0-9]+\.[0-9]+'
+ sed -i -E \
+ -e "s#releases/(download|tag)/v$v#releases/\1/$TAG#g" \
+ -e "s#(windows-x86_64-)?MaxRAR_${v}_x64-setup\.exe#MaxRAR_${version}_x64-setup.exe#g" \
+ -e "s#MaxRAR_${v}_macOS_(apple-silicon|intel)\.dmg#MaxRAR_${version}_macOS_\1.dmg#g" \
+ -e "s#MaxRAR_${v}_amd64\.deb#MaxRAR_${version}_amd64.deb#g" \
+ -e "s#MaxRAR-${v}-1\.x86_64\.rpm#MaxRAR-${version}-1.x86_64.rpm#g" \
+ -e "s#(linux-x86_64-)?MaxRAR_${v}_amd64\.AppImage#MaxRAR_${version}_amd64.AppImage#g" \
+ -e "s#MaxRAR v$v is available#MaxRAR $TAG is available#g" \
+ -e "s#v$v ·#$TAG ·#g" \
+ README.md
+ if git diff --quiet README.md; then
+ echo "README already up to date."
+ exit 0
+ fi
+ git config user.name "github-actions[bot]"
+ git config user.email "github-actions[bot]@users.noreply.github.com"
+ git commit -am "Update README download links to $TAG"
+ git push origin HEAD:main
diff --git a/README.md b/README.md
index f4c929e..1cd4ac6 100644
--- a/README.md
+++ b/README.md
@@ -32,7 +32,7 @@ MaxRAR is a desktop archive manager by [Matily](https://www.matily.org), built w
-v0.1.1 · Not sure which Mac? Apple menu → About This Mac · First-launch security warnings
+v0.1.1 · Not sure which Mac? Apple menu → About This Mac · First launch
[Release notes](https://github.com/MatilyLabs/MaxRAR/releases/tag/v0.1.1) · [All downloads](https://github.com/MatilyLabs/MaxRAR/releases) · [SHA-256 checksums](https://github.com/MatilyLabs/MaxRAR/releases/download/v0.1.1/SHA256SUMS.txt)
@@ -45,30 +45,22 @@ MaxRAR is a desktop archive manager by [Matily](https://www.matily.org), built w
Not sure which Mac you have? Open **Apple menu → About This Mac**. If it lists a chip such as “Apple M2”, choose Apple Silicon. If it lists an Intel processor, choose Intel.
-### First launch: security warnings are expected
+### First launch
-MaxRAR is not yet signed with a Windows publisher certificate (Authenticode) and the Mac apps are not Apple-notarized. Windows and macOS will therefore warn you the first time. This is expected for unsigned software; it is not a sign that the file is damaged. Before installing, you can compare the file’s SHA-256 with the [checksums file](https://github.com/MatilyLabs/MaxRAR/releases/download/v0.1.1/SHA256SUMS.txt) (Windows: `certutil -hashfile SHA256`; Mac/Linux: `shasum -a 256 `). Only continue if the values match and you downloaded from this repository’s releases page.
+From v0.1.2, the Windows installer and app are signed by the publisher (Ripon Chandra Malo, through Azure Artifact Signing), and the Mac apps are signed with an Apple Developer ID and notarized by Apple. You can compare a download with the [checksums file](https://github.com/MatilyLabs/MaxRAR/releases/download/v0.1.1/SHA256SUMS.txt) (Windows: `certutil -hashfile SHA256`; Mac/Linux: `shasum -a 256 `).
**Windows**
1. Run `windows-x86_64-MaxRAR_0.1.1_x64-setup.exe`.
-2. If you see **“Windows protected your PC”** (Microsoft Defender SmartScreen), choose **More info**, then **Run anyway**.
+2. Windows SmartScreen may still show **“Windows protected your PC”** while the new signature builds reputation. Check that the publisher is Ripon Chandra Malo, choose **More info**, then **Run anyway**.
3. Follow the installer, then open **MaxRAR** from the Start menu.
-4. On Windows 11, the right-click actions appear under **Show more options**. Use **Send to → Compress with MaxRAR** for several files or folders.
+4. On Windows 11, right-click files or folders and choose **MaxRAR**. On Windows 10 the commands are in the classic right-click menu, and **Send to → Compress with MaxRAR** works for several items.
**macOS**
1. Open the DMG for your Mac and drag **MaxRAR** into **Applications**.
-2. Open MaxRAR from Applications. macOS will likely say it can’t verify the app or that it “cannot be opened”. Click **Done** (or **Cancel**), don’t move it to the Bin.
-3. Open **System Settings → Privacy & Security**, scroll to the Security section, and click **Open Anyway** next to the MaxRAR message. Confirm with your password or Touch ID, then click **Open**. You only need to do this once.
- - On macOS 14 and earlier you can instead right-click (Control-click) MaxRAR in Applications, choose **Open**, then **Open** again.
-4. If macOS says the app is **“damaged”**, remove the download quarantine flag in Terminal, then open it again:
-
- ```sh
- xattr -dr com.apple.quarantine /Applications/MaxRAR.app
- ```
-
-5. To add Finder compress/extract actions, choose **Help → Desktop integration → Enable desktop actions**.
+2. Open MaxRAR from Applications. macOS asks once whether to open an app downloaded from the internet; click **Open**.
+3. To add Finder compress/extract actions, choose **Help → Desktop integration → Enable desktop actions**.
**Linux**
@@ -84,7 +76,7 @@ Install the DEB or RPM with your package manager so system libraries are resolve
See the [user manual](docs/USER-MANUAL.md) and [desktop integration guide](docs/DESKTOP-INTEGRATION.md) for more.
-MaxRAR’s original code is licensed under [Apache License 2.0](LICENSE). The release includes [license texts and notices](https://github.com/MatilyLabs/MaxRAR/releases/download/v0.1.1/MaxRAR-0.1.1-Licenses.zip).
+MaxRAR’s original code is licensed under [Apache License 2.0](LICENSE). License texts and notices are in [NOTICE](NOTICE) and [THIRD-PARTY-NOTICES.md](THIRD-PARTY-NOTICES.md).
## Why MaxRAR?
diff --git a/docs/RELEASE-UPDATES.md b/docs/RELEASE-UPDATES.md
index 5df81dd..9720db5 100644
--- a/docs/RELEASE-UPDATES.md
+++ b/docs/RELEASE-UPDATES.md
@@ -14,14 +14,11 @@ Updater signatures are separate from Windows Authenticode and macOS Developer ID
1. Increase the version in `Cargo.toml`, `package.json`, `package-lock.json` and `src-tauri/tauri.conf.json`; regenerate `Cargo.lock`. Write `docs/releases/vVERSION.md`.
2. Preserve the existing update signing key. Its encrypted private key and password are GitHub repository secrets named `TAURI_SIGNING_PRIVATE_KEY` and `TAURI_SIGNING_PRIVATE_KEY_PASSWORD`. Keep a protected recoverable backup outside the repository. Do not regenerate or replace it casually: installed apps trust the existing public key.
-3. Commit the release source and push the matching `vVERSION` tag. Prepare an empty draft with your maintainer account, then dispatch **Release packages and signed updates (manual)** on that tag. For v0.1.2, use `git tag -a v0.1.2 -m "MaxRAR v0.1.2"`, `git push origin v0.1.2`, `gh release create v0.1.2 --verify-tag --draft --title "MaxRAR v0.1.2" --notes-file docs/releases/v0.1.2.md`, then `gh workflow run prepare-updates.yml --ref v0.1.2`. The workflow checks the tag and draft before starting expensive builds. It is separate from routine Desktop and CLI validation and is not triggered by documentation edits, pushes or tags.
-4. Each of the four platform jobs validates configuration, runs checks, creates initial installers and signed updater packages, verifies package signatures and signed versions, and checks that tampered content is rejected.
-5. The final job requires all four platforms. It combines their entries into `latest.json`, includes license notices and SHA-256 checksums, and attaches the files to the prepared **draft** GitHub release. No incomplete platform feed is published.
-6. Review the draft and test installed packages. Publishing a non-prerelease as **latest** makes its `latest.json` available at the fixed endpoint, provided the repository is public. Updating another release without this feed would break the latest-release endpoint; always publish the complete release set.
+3. Merge to `main`, then tag that commit and push the tag: `git tag -a v0.1.2 -m "MaxRAR v0.1.2"` and `git push origin v0.1.2`. That is the whole release step.
+4. The **Release** workflow (`.github/workflows/release.yml`) checks that the tag matches the app version and that the notes exist, creates a draft release (or reuses an existing draft for that tag), and builds Windows x64, macOS Apple Silicon, macOS Intel and Linux x64 in parallel. Windows is signed with Azure Artifact Signing; Mac builds are signed and notarized with the Developer ID certificate; updater packages are signed with the Tauri key.
+5. After all four builds succeed, the workflow names the Mac DMGs for each chip, writes `latest.json` and `SHA256SUMS.txt`, publishes the release as **latest** with the notes from `docs/releases/vVERSION.md`, and points the README download links at the new version.
-The version tag pins the exact build source while the branch advances. GitHub can require workflow-write authorization when creating or editing release metadata for a commit whose workflow files differ from the default branch. The built-in workflow token cannot receive that permission. A maintainer prepares the draft; CI only uploads assets with Contents write permission. No personal token is stored in Actions for publishing. See [GitHub’s release API permission rules](https://docs.github.com/en/rest/releases/releases#create-a-release).
-
-To recover assembly using already verified packages, dispatch the current workflow with `gh workflow run prepare-updates.yml --ref main -f source_run_id=RUN_ID`. This checks that the original run has four successful platform jobs, its commit matches the version tag, and its release/signing configuration matches. Platform builds are skipped. Assembly replaces its own CI artifact, resumes partial draft asset uploads, and refuses to overwrite a published release. The current checkout must still have the same release version and signing configuration as the original build.
+Tests run on every push and pull request in the **Desktop and CLI** workflow, not again during the release. If a platform build fails, fix it on `main`, then move the tag (`git tag -fa vVERSION -m "MaxRAR vVERSION"`, `git push -f origin vVERSION`); the workflow reuses the same draft.
The signing key was generated using the official Tauri CLI. Its public counterpart is safe to distribute. The signing private key/password must never enter source control, logs, release assets or application configuration.
@@ -42,7 +39,7 @@ The native staging verifier is also available locally:
cargo run --locked -p wonrar-desktop --example verify-updates -- /path/to/staged-release
```
-It verifies real package bytes and the authenticated version using the same Minisign library used by Tauri, then checks that modified bytes are rejected. Each release platform runs this verifier in CI; it does not execute installers or establish installed upgrade behavior.
+It verifies real package bytes and the authenticated version using the same Minisign library used by Tauri, then checks that modified bytes are rejected. It does not execute installers or establish installed upgrade behavior.
## In-app behavior
diff --git a/docs/releases/v0.1.2.md b/docs/releases/v0.1.2.md
index 7517f2e..b97a3aa 100644
--- a/docs/releases/v0.1.2.md
+++ b/docs/releases/v0.1.2.md
@@ -11,6 +11,6 @@
## Installing
-Existing v0.1.1 installations can update from **About MaxRAR**. Otherwise choose the Windows installer, the Mac DMG for your chip, or a Linux package from this release. The `darwin-*`, `windows-*` and `linux-*` files are for the in-app updater; you do not need to download them.
+Existing v0.1.1 installations can update from **About MaxRAR**. Otherwise choose the Windows installer, the Mac DMG for your chip, or a Linux package from this release. The `.sig`, `.app.tar.gz` and `latest.json` files are for the in-app updater; you do not need to download them.
MRAR remains experimental: keep your originals and use established formats for exchange and backups. Older MaxRAR versions cannot open MRAR/2 archives. RAR creation, multipart RAR and self-extracting RAR are not supported. Scan remains limited local inspection, not comprehensive antivirus protection.
diff --git a/scripts/assemble-release.py b/scripts/assemble-release.py
deleted file mode 100644
index 305f4f9..0000000
--- a/scripts/assemble-release.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/env python3
-"""Combine all four verified platform artifacts into a complete release feed."""
-import argparse
-from datetime import datetime, timezone
-import hashlib
-import importlib.util
-import json
-from pathlib import Path
-import shutil
-from urllib.parse import quote, unquote
-import zipfile
-
-ROOT = Path(__file__).resolve().parent.parent
-spec = importlib.util.spec_from_file_location('stage_update', ROOT / 'scripts/stage-update.py')
-stage = importlib.util.module_from_spec(spec)
-spec.loader.exec_module(stage)
-PLATFORMS = set(stage.SUFFIXES)
-
-
-def assemble(source, output, notes):
- source, output = Path(source), Path(output)
- assert not output.exists() or not any(output.iterdir()), 'Release output must be empty'
- config = json.loads((ROOT / 'release.config.json').read_text())
- version = json.loads((ROOT / 'src-tauri/tauri.conf.json').read_text())['version']
- prefix = config['repository'] + '/releases/download/v' + version + '/'
- platforms = {}
- files = {}
- for path in sorted(source.rglob('*.json')):
- manifest = json.loads(path.read_text())
- assert manifest['version'] == version, 'Mixed release versions'
- assert len(manifest['platforms']) == 1, 'Expected one platform per staging manifest'
- platform, entry = next(iter(manifest['platforms'].items()))
- assert platform in PLATFORMS and platform not in platforms, 'Duplicate or unknown platform'
- assert entry['url'].startswith(prefix), 'Update URL must target this release'
- name = unquote(entry['url'][len(prefix):])
- assert Path(name).name == name and name.startswith(platform + '-'), 'Invalid platform asset name'
- assert entry['url'] == prefix + quote(name), 'Unexpected asset URL encoding'
- asset = path.parent / name
- assert asset.is_file(), 'Updater asset is missing'
- assert name.endswith(stage.SUFFIXES[platform]), 'Wrong updater asset type'
- assert (path.parent / (name + '.sig')).read_text().strip() == entry['signature'], 'Signature sidecar differs'
- assert stage.signature_version(entry['signature']) == version, 'Signature version differs'
- platforms[platform] = entry
- for item in path.parent.iterdir():
- if item.is_file() and item.suffix != '.json' and item.name not in ('LICENSE', 'NOTICE', 'THIRD-PARTY-NOTICES.md'):
- assert item.name not in files, 'Duplicate release asset'
- files[item.name] = item
- assert set(platforms) == PLATFORMS, 'All four platforms are required'
- assert sum(name.endswith('.dmg') for name in files) == 2, 'Both Mac installers are required'
- assert any(name.endswith('.deb') for name in files) and any(name.endswith('.rpm') for name in files), 'Linux DEB and RPM are required'
- output.mkdir(parents=True, exist_ok=True)
- for name, item in files.items():
- shutil.copy2(item, output / name)
- feed = {'version': version, 'notes': Path(notes).read_text(), 'pub_date': datetime.now(timezone.utc).isoformat(), 'platforms': platforms}
- (output / 'latest.json').write_text(json.dumps(feed, indent=2) + '\n')
- with zipfile.ZipFile(output / f'MaxRAR-{version}-Licenses.zip', 'w', zipfile.ZIP_DEFLATED) as archive:
- for name in ('LICENSE', 'NOTICE', 'THIRD-PARTY-NOTICES.md'):
- archive.write(ROOT / name, name)
- for folder in ('licenses', 'design/icons/fluent', 'crates/wonrar-scan/rules'):
- for item in sorted((ROOT / folder).rglob('*')):
- if item.is_file():
- archive.write(item, str(item.relative_to(ROOT)))
- hashes = [hashlib.sha256(item.read_bytes()).hexdigest() + ' ' + item.name for item in sorted(output.iterdir())]
- (output / 'SHA256SUMS.txt').write_text('\n'.join(hashes) + '\n')
- print(f'MaxRAR {version}: complete four-platform feed and {len(files)} package/signature assets staged.')
- return feed
-
-
-if __name__ == '__main__':
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('--source', required=True)
- parser.add_argument('--output', required=True)
- parser.add_argument('--notes', required=True)
- args = parser.parse_args()
- assemble(args.source, args.output, args.notes)
diff --git a/scripts/check-release-tag.py b/scripts/check-release-tag.py
deleted file mode 100644
index 37a7948..0000000
--- a/scripts/check-release-tag.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python3
-"""Require an existing version tag at the exact build commit before release builds."""
-import argparse
-import json
-import base64
-from pathlib import Path
-import re
-import subprocess
-
-ROOT = Path(__file__).resolve().parent.parent
-
-
-def check(repository, commit):
- version = json.loads((ROOT / 'src-tauri/tauri.conf.json').read_text())['version']
- tag = 'v' + version
- result = subprocess.run(['gh', 'api', f'repos/{repository}/commits/{tag}'], capture_output=True, text=True)
- if result.returncode:
- raise SystemExit(f'Push the {tag} version tag before starting release builds. No builds have started.')
- if json.loads(result.stdout)['sha'] != commit:
- raise SystemExit(f'{tag} does not point to this workflow commit. Dispatch the workflow on {tag}.')
- result = subprocess.run(['gh', 'release', 'view', tag, '--repo', repository, '--json', 'isDraft'], capture_output=True, text=True)
- if result.returncode:
- raise SystemExit(f'Prepare the {tag} draft release with your maintainer account before building.')
- if not json.loads(result.stdout)['isDraft']:
- raise SystemExit(f'{tag} is already published; refusing to replace its packages.')
- print(f'{tag}: existing tag matches {commit} and its draft is ready.')
-
-
-def verified_source(repository, run_id):
- if not re.fullmatch(r'[0-9]+', run_id):
- raise SystemExit('Source run must be a numeric GitHub Actions run ID.')
- def api(path):
- return json.loads(subprocess.check_output(['gh', 'api', f'repos/{repository}/{path}'], text=True))
- run = api(f'actions/runs/{run_id}')
- workflow = api('actions/workflows/prepare-updates.yml')
- if run['workflow_id'] != workflow['id']:
- raise SystemExit('Source run is not the MaxRAR signed release workflow.')
- jobs = api(f'actions/runs/{run_id}/jobs?per_page=100')['jobs']
- platforms = [job for job in jobs if job['name'].startswith('Signed release')]
- if len(platforms) != 4 or any(job['conclusion'] != 'success' for job in platforms):
- raise SystemExit('Source run must contain four successful signed platform jobs.')
- commit = run['head_sha']
- source_config = api(f'contents/release.config.json?ref={commit}')
- source_config = json.loads(base64.b64decode(source_config['content']))
- current_config = json.loads((ROOT / 'release.config.json').read_text())
- if source_config != current_config:
- raise SystemExit('Source signing key or release configuration differs; do not mix release artifacts.')
- return commit
-
-
-if __name__ == '__main__':
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('--repository', required=True)
- parser.add_argument('--commit', required=True)
- parser.add_argument('--source-run', default='')
- parser.add_argument('--current-run', default='')
- parser.add_argument('--output')
- args = parser.parse_args()
- commit = verified_source(args.repository, args.source_run) if args.source_run else args.commit
- check(args.repository, commit)
- if args.output:
- run_id = args.source_run or args.current_run
- if not re.fullmatch(r'[0-9]+', run_id):
- raise SystemExit('Missing current workflow run ID.')
- with Path(args.output).open('a') as output:
- output.write(f'run_id={run_id}\n')
diff --git a/scripts/stage-update.py b/scripts/stage-update.py
deleted file mode 100644
index 2bd6e61..0000000
--- a/scripts/stage-update.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python3
-"""Stage signed updater assets locally. Does not create or publish a GitHub release."""
-import argparse
-import base64
-import json
-import pathlib
-import re
-import shutil
-import urllib.parse
-
-SUFFIXES = {'darwin-aarch64': '.app.tar.gz', 'darwin-x86_64': '.app.tar.gz',
- 'windows-x86_64': '.exe', 'linux-x86_64': '.AppImage'}
-# Mac installers are named for the chip a person chooses on the download page.
-DMG_NAMES = {'darwin-aarch64': 'MaxRAR_{version}_macOS_apple-silicon.dmg',
- 'darwin-x86_64': 'MaxRAR_{version}_macOS_intel.dmg'}
-
-def signature_version(signature):
- try:
- text = base64.b64decode(signature, validate=True).decode('utf-8')
- comment = next(line.removeprefix('trusted comment: ') for line in text.splitlines()
- if line.startswith('trusted comment: '))
- return next(field.removeprefix('version:') for field in comment.split('\t')
- if field.startswith('version:'))
- except (ValueError, UnicodeError, StopIteration) as error:
- raise ValueError('Signature must include a signed application version') from error
-
-def stage(root, platform, version, output):
- if not re.fullmatch(r'\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?', version):
- raise ValueError('Version must be a semantic version without a v prefix')
- config = json.loads((pathlib.Path(__file__).resolve().parent.parent / 'release.config.json').read_text())
- candidates = [p for p in pathlib.Path(root).rglob('*' + SUFFIXES[platform])
- if p.is_file() and pathlib.Path(str(p) + '.sig').is_file()]
- if len(candidates) != 1:
- raise ValueError(f'Expected one signed updater asset for {platform}; found {len(candidates)}')
- asset = candidates[0]
- signature = pathlib.Path(str(asset) + '.sig').read_text().strip()
- if not signature or len(signature) > 8192 or signature_version(signature) != version:
- raise ValueError('Missing or invalid signature file')
- output = pathlib.Path(output)
- output.mkdir(parents=True, exist_ok=True)
- # Include platform in the staged name so Intel/Apple-Silicon assets cannot collide.
- name = platform + '-' + asset.name
- shutil.copy2(asset, output / name)
- shutil.copy2(str(asset) + '.sig', output / (name + '.sig'))
- # Initial installations and updater downloads come from the same build.
- extras = ['*.dmg'] if platform.startswith('darwin-') else ['*.deb', '*.rpm'] if platform.startswith('linux-') else []
- for pattern in extras:
- for installer in pathlib.Path(root).rglob(pattern):
- shutil.copy2(installer, output / DMG_NAMES.get(platform, installer.name).format(version=version))
- url = config['repository'] + '/releases/download/v' + version + '/' + urllib.parse.quote(name)
- manifest = {'version': version, 'notes': '', 'platforms': {platform: {'url': url, 'signature': signature}}}
- (output / (platform + '.json')).write_text(json.dumps(manifest, indent=2) + '\n')
- return manifest
-
-if __name__ == '__main__':
- parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument('--root', required=True)
- parser.add_argument('--platform', required=True, choices=SUFFIXES)
- parser.add_argument('--version', required=True)
- parser.add_argument('--output', default='release-stage')
- args = parser.parse_args()
- stage(args.root, args.platform, args.version, args.output)
diff --git a/verification/test_release_staging.py b/verification/test_release_staging.py
deleted file mode 100644
index b66dcfd..0000000
--- a/verification/test_release_staging.py
+++ /dev/null
@@ -1,76 +0,0 @@
-import importlib.util
-import base64
-import json
-import pathlib
-import tempfile
-import unittest
-
-spec = importlib.util.spec_from_file_location('stage_update', pathlib.Path(__file__).resolve().parent.parent / 'scripts/stage-update.py')
-module = importlib.util.module_from_spec(spec)
-spec.loader.exec_module(module)
-
-def signature(version):
- # Structural fixture only; the native release verifier checks real signatures.
- return base64.b64encode(f'untrusted comment: test\nfixture\ntrusted comment: timestamp:1\tversion:{version}\nfixture\n'.encode()).decode()
-
-class StagingTests(unittest.TestCase):
- def test_signed_assets_get_distinct_platform_names_and_encoded_urls(self):
- with tempfile.TemporaryDirectory() as tmp:
- root = pathlib.Path(tmp)
- source = root / 'source'
- source.mkdir()
- asset = source / 'MaxRAR app.app.tar.gz'
- asset.write_bytes(b'fixture')
- pathlib.Path(str(asset) + '.sig').write_text(signature('0.2.0'))
- a = module.stage(source, 'darwin-aarch64', '0.2.0', root/'out-arm')
- b = module.stage(source, 'darwin-x86_64', '0.2.0', root/'out-intel')
- url = a['platforms']['darwin-aarch64']['url']
- self.assertIn('/MatilyLabs/MaxRAR/releases/download/v0.2.0/darwin-aarch64-', url)
- self.assertIn('%20', url)
- self.assertNotEqual(url, b['platforms']['darwin-x86_64']['url'])
-
- def test_missing_signature_and_invalid_version_cannot_be_staged(self):
- with tempfile.TemporaryDirectory() as tmp:
- root = pathlib.Path(tmp)
- (root/'app.exe').write_bytes(b'fixture')
- with self.assertRaises(ValueError): module.stage(root,'windows-x86_64','0.2.0',root/'out')
- with self.assertRaises(ValueError): module.stage(root,'windows-x86_64','latest',root/'out')
-
- def test_signature_cannot_announce_another_version(self):
- with tempfile.TemporaryDirectory() as tmp:
- root = pathlib.Path(tmp)
- (root/'app.exe').write_bytes(b'fixture')
- (root/'app.exe.sig').write_text(signature('0.1.0'))
- with self.assertRaises(ValueError): module.stage(root,'windows-x86_64','0.2.0',root/'out')
-
- def test_complete_feed_requires_all_platforms_and_matching_signature_sidecars(self):
- assemble_spec = importlib.util.spec_from_file_location('assemble_release', pathlib.Path(__file__).resolve().parent.parent / 'scripts/assemble-release.py')
- assemble = importlib.util.module_from_spec(assemble_spec)
- assemble_spec.loader.exec_module(assemble)
- version = json.loads((assemble.ROOT/'src-tauri/tauri.conf.json').read_text())['version']
- with tempfile.TemporaryDirectory() as tmp:
- root = pathlib.Path(tmp)
- notes = root/'notes.md'; notes.write_text('Fixture notes')
- for platform, suffix in module.SUFFIXES.items():
- source = root/'source'/platform; source.mkdir(parents=True)
- asset = source/('MaxRAR'+suffix)
- asset.write_bytes(b'fixture')
- pathlib.Path(str(asset)+'.sig').write_text(signature(version))
- if platform.startswith('darwin-'): (source/f'MaxRAR-{platform}.dmg').write_bytes(b'installer')
- if platform.startswith('linux-'):
- for ext in ('deb','rpm'): (source/f'MaxRAR.{ext}').write_bytes(b'installer')
- module.stage(source,platform,version,root/'staged'/platform)
- feed = assemble.assemble(root/'staged',root/'out',notes)
- self.assertEqual(set(feed['platforms']),set(module.SUFFIXES))
- self.assertTrue((root/'out/SHA256SUMS.txt').is_file())
- self.assertTrue((root/f'out/MaxRAR_{version}_macOS_apple-silicon.dmg').is_file())
- self.assertTrue((root/f'out/MaxRAR_{version}_macOS_intel.dmg').is_file())
- self.assertEqual(feed['notes'],'Fixture notes')
- sidecar = next((root/'staged/windows-x86_64').glob('*.sig'))
- sidecar.write_text(signature('0.0.0'))
- with self.assertRaises(AssertionError): assemble.assemble(root/'staged',root/'bad-signature',notes)
- sidecar.write_text(signature(version))
- (root/'staged/windows-x86_64/windows-x86_64.json').unlink()
- with self.assertRaises(AssertionError): assemble.assemble(root/'staged',root/'incomplete',notes)
-
-if __name__ == '__main__': unittest.main()
diff --git a/verification/test_release_tag.py b/verification/test_release_tag.py
deleted file mode 100644
index 70a54b1..0000000
--- a/verification/test_release_tag.py
+++ /dev/null
@@ -1,53 +0,0 @@
-import importlib.util
-import json
-from pathlib import Path
-import subprocess
-import unittest
-from unittest.mock import patch
-
-spec = importlib.util.spec_from_file_location('check_release_tag', Path(__file__).resolve().parent.parent / 'scripts/check-release-tag.py')
-module = importlib.util.module_from_spec(spec)
-spec.loader.exec_module(module)
-
-
-def response(code=0, data=None, error=''):
- return subprocess.CompletedProcess([], code, json.dumps(data), error)
-
-
-class ReleaseTagTests(unittest.TestCase):
- def test_matching_existing_tag_can_start_a_new_release(self):
- with patch.object(module.subprocess, 'run', side_effect=[response(data={'sha': 'built-commit'}), response(data={'isDraft': True})]):
- module.check('MatilyLabs/MaxRAR', 'built-commit')
-
- def test_missing_or_moved_tag_stops_before_building(self):
- for result in [response(1, error='HTTP 404'), response(data={'sha': 'other-commit'})]:
- with self.subTest(result=result), patch.object(module.subprocess, 'run', return_value=result):
- with self.assertRaises(SystemExit): module.check('MatilyLabs/MaxRAR', 'built-commit')
-
- def test_published_release_cannot_have_its_packages_replaced(self):
- with patch.object(module.subprocess, 'run', side_effect=[response(data={'sha': 'built-commit'}), response(data={'isDraft': False})]):
- with self.assertRaises(SystemExit): module.check('MatilyLabs/MaxRAR', 'built-commit')
-
- def test_access_error_is_not_treated_as_absent_release(self):
- with patch.object(module.subprocess, 'run', side_effect=[response(data={'sha': 'built-commit'}), response(1, error='HTTP 403')]):
- with self.assertRaises(SystemExit): module.check('MatilyLabs/MaxRAR', 'built-commit')
-
- def test_missing_draft_stops_before_building(self):
- with patch.object(module.subprocess, 'run', side_effect=[response(data={'sha': 'built-commit'}), response(1, error='release not found')]):
- with self.assertRaises(SystemExit): module.check('MatilyLabs/MaxRAR', 'built-commit')
-
- def test_assembly_reuse_requires_four_verified_platforms_from_this_workflow(self):
- config = json.loads((module.ROOT/'release.config.json').read_text())
- import base64
- encoded = base64.b64encode(json.dumps(config).encode()).decode()
- jobs = [{'name': f'Signed release ({platform})', 'conclusion': 'success'} for platform in ('windows', 'linux', 'arm', 'intel')]
- replies = [{'workflow_id': 7, 'head_sha': 'built-commit'}, {'id': 7}, {'jobs': jobs}, {'content': encoded}]
- with patch.object(module.subprocess, 'check_output', side_effect=[json.dumps(item) for item in replies]):
- self.assertEqual(module.verified_source('MatilyLabs/MaxRAR', '123'), 'built-commit')
- jobs[0]['conclusion'] = 'failure'
- with patch.object(module.subprocess, 'check_output', side_effect=[json.dumps(item) for item in replies]):
- with self.assertRaises(SystemExit): module.verified_source('MatilyLabs/MaxRAR', '123')
- with self.assertRaises(SystemExit): module.verified_source('MatilyLabs/MaxRAR', 'not-a-run-id')
-
-
-if __name__ == '__main__': unittest.main()