diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5cc42ed..0be1d60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -386,11 +386,6 @@ jobs: exit 1 fi - - name: Install makepkg - run: | - sudo apt-get update - sudo apt-get install -y makepkg - - name: Configure SSH for AUR env: AUR_SSH_PRIVATE_KEY: ${{ secrets.AUR_SSH_PRIVATE_KEY }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 366b3a0..8e8a987 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## v0.6.4 (2026-03-15) + +### Internal +- Release: Reworked AUR metadata generation to update `.SRCINFO` directly instead of depending on runner `makepkg`, fixing tagged release publishing for `subminer-bin`. + ## v0.6.3 (2026-03-15) ### Changed diff --git a/docs-site/changelog.md b/docs-site/changelog.md index 169f364..9ec7e3a 100644 --- a/docs-site/changelog.md +++ b/docs-site/changelog.md @@ -1,5 +1,8 @@ # Changelog +## v0.6.4 (2026-03-15) +- Reworked AUR metadata generation to update `.SRCINFO` directly instead of depending on runner `makepkg`, fixing tagged release publishing for `subminer-bin`. + ## v0.6.3 (2026-03-15) - Expanded `Alt+C` into an inline controller config/remap flow with preferred-controller saving and per-action learn mode for buttons, triggers, and stick directions. - Automated `subminer-bin` AUR package updates from the tagged release workflow. diff --git a/package.json b/package.json index 0d898ba..111889c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "subminer", - "version": "0.6.3", + "version": "0.6.4", "description": "All-in-one sentence mining overlay with AnkiConnect and dictionary integration", "packageManager": "bun@1.3.5", "main": "dist/main-entry.js", @@ -54,7 +54,7 @@ "test:launcher": "bun run test:launcher:src", "test:core": "bun run test:core:src", "test:subtitle": "bun run test:subtitle:src", - "test:fast": "bun run test:config:src && bun run test:core:src && bun test src/main-entry-runtime.test.ts src/anki-integration/anki-connect-proxy.test.ts src/release-workflow.test.ts src/ci-workflow.test.ts scripts/build-changelog.test.ts scripts/mkv-to-readme-video.test.ts && bun run tsc && bun test dist/main/runtime/registry.test.js", + "test:fast": "bun run test:config:src && bun run test:core:src && bun test src/main-entry-runtime.test.ts src/anki-integration/anki-connect-proxy.test.ts src/release-workflow.test.ts src/ci-workflow.test.ts scripts/build-changelog.test.ts scripts/mkv-to-readme-video.test.ts scripts/update-aur-package.test.ts && bun run tsc && bun test dist/main/runtime/registry.test.js", "generate:config-example": "bun run src/generate-config-example.ts", "verify:config-example": "bun run src/verify-config-example.ts", "start": "bun run build && electron . --start", diff --git a/release/release-notes.md b/release/release-notes.md index 6b3f6ec..bab84b6 100644 --- a/release/release-notes.md +++ b/release/release-notes.md @@ -1,10 +1,6 @@ ## Highlights -### Changed -- Overlay: Expanded the `Alt+C` controller modal into an inline config/remap flow with preferred-controller saving and per-action learn mode for buttons, triggers, and stick directions. - ### Internal -- Workflow: Hardened the `subminer-scrum-master` skill to explicitly answer whether docs updates and changelog fragments are required before handoff. -- Release: Automate `subminer-bin` AUR package updates from the tagged release workflow. +- Release: Reworked AUR metadata generation to update `.SRCINFO` directly instead of depending on runner `makepkg`, fixing tagged release publishing for `subminer-bin`. ## Installation diff --git a/scripts/update-aur-package.sh b/scripts/update-aur-package.sh index ff795e9..0ca2a12 100755 --- a/scripts/update-aur-package.sh +++ b/scripts/update-aur-package.sh @@ -54,6 +54,7 @@ fi version="${version#v}" pkgbuild="${pkg_dir}/PKGBUILD" +srcinfo="${pkg_dir}/.SRCINFO" if [[ ! -f "$pkgbuild" ]]; then echo "Missing PKGBUILD at $pkgbuild" >&2 @@ -118,7 +119,96 @@ awk \ ' "$pkgbuild" > "$tmpfile" mv "$tmpfile" "$pkgbuild" -( - cd "$pkg_dir" - makepkg --printsrcinfo > .SRCINFO -) +if [[ ! -f "$srcinfo" ]]; then + echo "Missing .SRCINFO at $srcinfo" >&2 + exit 1 +fi + +tmpfile="$(mktemp)" +awk \ + -v version="$version" \ + -v sum_appimage="${sha256sums[0]}" \ + -v sum_wrapper="${sha256sums[1]}" \ + -v sum_assets="${sha256sums[2]}" \ + ' + BEGIN { + sha_index = 0 + found_pkgver = 0 + found_provides = 0 + found_noextract = 0 + found_source_appimage = 0 + found_source_wrapper = 0 + found_source_assets = 0 + } + /^\tpkgver = / { + print "\tpkgver = " version + found_pkgver = 1 + next + } + /^\tprovides = subminer=/ { + print "\tprovides = subminer=" version + found_provides = 1 + next + } + /^\tnoextract = SubMiner-.*\.AppImage$/ { + print "\tnoextract = SubMiner-" version ".AppImage" + found_noextract = 1 + next + } + /^\tsource = SubMiner-.*\.AppImage::https:\/\/github\.com\/ksyasuda\/SubMiner\/releases\/download\/v.*\/SubMiner-.*\.AppImage$/ { + print "\tsource = SubMiner-" version ".AppImage::https://github.com/ksyasuda/SubMiner/releases/download/v" version "/SubMiner-" version ".AppImage" + found_source_appimage = 1 + next + } + /^\tsource = subminer::https:\/\/github\.com\/ksyasuda\/SubMiner\/releases\/download\/v.*\/subminer$/ { + print "\tsource = subminer::https://github.com/ksyasuda/SubMiner/releases/download/v" version "/subminer" + found_source_wrapper = 1 + next + } + /^\tsource = subminer-assets\.tar\.gz::https:\/\/github\.com\/ksyasuda\/SubMiner\/releases\/download\/v.*\/subminer-assets\.tar\.gz$/ { + print "\tsource = subminer-assets.tar.gz::https://github.com/ksyasuda/SubMiner/releases/download/v" version "/subminer-assets.tar.gz" + found_source_assets = 1 + next + } + /^\tsha256sums = / { + sha_index += 1 + if (sha_index == 1) { + print "\tsha256sums = " sum_appimage + next + } + if (sha_index == 2) { + print "\tsha256sums = " sum_wrapper + next + } + if (sha_index == 3) { + print "\tsha256sums = " sum_assets + next + } + } + { + print + } + END { + if (!found_pkgver) { + print "Missing pkgver entry in .SRCINFO" > "/dev/stderr" + exit 1 + } + if (!found_provides) { + print "Missing provides entry in .SRCINFO" > "/dev/stderr" + exit 1 + } + if (!found_noextract) { + print "Missing noextract entry in .SRCINFO" > "/dev/stderr" + exit 1 + } + if (!found_source_appimage || !found_source_wrapper || !found_source_assets) { + print "Missing source entry in .SRCINFO" > "/dev/stderr" + exit 1 + } + if (sha_index < 3) { + print "Missing sha256sums entries in .SRCINFO" > "/dev/stderr" + exit 1 + } + } + ' "$srcinfo" > "$tmpfile" +mv "$tmpfile" "$srcinfo" diff --git a/scripts/update-aur-package.test.ts b/scripts/update-aur-package.test.ts new file mode 100644 index 0000000..5a53b54 --- /dev/null +++ b/scripts/update-aur-package.test.ts @@ -0,0 +1,67 @@ +import assert from 'node:assert/strict'; +import { execFileSync } from 'node:child_process'; +import fs from 'node:fs'; +import os from 'node:os'; +import path from 'node:path'; +import test from 'node:test'; + +function createWorkspace(name: string): string { + return fs.mkdtempSync(path.join(os.tmpdir(), `${name}-`)); +} + +test('update-aur-package updates PKGBUILD and .SRCINFO without makepkg', () => { + const workspace = createWorkspace('subminer-aur-package'); + const pkgDir = path.join(workspace, 'aur-subminer-bin'); + const appImagePath = path.join(workspace, 'SubMiner-0.6.3.AppImage'); + const wrapperPath = path.join(workspace, 'subminer'); + const assetsPath = path.join(workspace, 'subminer-assets.tar.gz'); + + fs.mkdirSync(pkgDir, { recursive: true }); + fs.copyFileSync('packaging/aur/subminer-bin/PKGBUILD', path.join(pkgDir, 'PKGBUILD')); + fs.copyFileSync('packaging/aur/subminer-bin/.SRCINFO', path.join(pkgDir, '.SRCINFO')); + fs.writeFileSync(appImagePath, 'appimage'); + fs.writeFileSync(wrapperPath, 'wrapper'); + fs.writeFileSync(assetsPath, 'assets'); + + try { + execFileSync( + 'bash', + [ + 'scripts/update-aur-package.sh', + '--pkg-dir', + pkgDir, + '--version', + 'v0.6.3', + '--appimage', + appImagePath, + '--wrapper', + wrapperPath, + '--assets', + assetsPath, + ], + { + cwd: process.cwd(), + encoding: 'utf8', + }, + ); + + const pkgbuild = fs.readFileSync(path.join(pkgDir, 'PKGBUILD'), 'utf8'); + const srcinfo = fs.readFileSync(path.join(pkgDir, '.SRCINFO'), 'utf8'); + const expectedSums = [appImagePath, wrapperPath, assetsPath].map((filePath) => + execFileSync('sha256sum', [filePath], { encoding: 'utf8' }).split(/\s+/)[0], + ); + + assert.match(pkgbuild, /^pkgver=0\.6\.3$/m); + assert.match(srcinfo, /^\tpkgver = 0\.6\.3$/m); + assert.match(srcinfo, /^\tprovides = subminer=0\.6\.3$/m); + assert.match( + srcinfo, + /^\tsource = SubMiner-0\.6\.3\.AppImage::https:\/\/github\.com\/ksyasuda\/SubMiner\/releases\/download\/v0\.6\.3\/SubMiner-0\.6\.3\.AppImage$/m, + ); + assert.match(srcinfo, new RegExp(`^\\tsha256sums = ${expectedSums[0]}$`, 'm')); + assert.match(srcinfo, new RegExp(`^\\tsha256sums = ${expectedSums[1]}$`, 'm')); + assert.match(srcinfo, new RegExp(`^\\tsha256sums = ${expectedSums[2]}$`, 'm')); + } finally { + fs.rmSync(workspace, { recursive: true, force: true }); + } +}); diff --git a/src/release-workflow.test.ts b/src/release-workflow.test.ts index fb6f5fa..e222bfc 100644 --- a/src/release-workflow.test.ts +++ b/src/release-workflow.test.ts @@ -72,7 +72,6 @@ test('release workflow publishes subminer-bin to AUR from tagged release artifac assert.match(releaseWorkflow, /needs:\s*\[release\]/); assert.match(releaseWorkflow, /AUR_SSH_PRIVATE_KEY/); assert.match(releaseWorkflow, /ssh:\/\/aur@aur\.archlinux\.org\/subminer-bin\.git/); - assert.match(releaseWorkflow, /Install makepkg/); assert.match(releaseWorkflow, /scripts\/update-aur-package\.sh/); assert.match(releaseWorkflow, /version_no_v="\$\{\{ steps\.version\.outputs\.VERSION \}\}"/); assert.match(releaseWorkflow, /SubMiner-\$\{version_no_v\}\.AppImage/); @@ -80,6 +79,7 @@ test('release workflow publishes subminer-bin to AUR from tagged release artifac releaseWorkflow, /SubMiner-\$\{\{ steps\.version\.outputs\.VERSION \}\}\.AppImage/, ); + assert.doesNotMatch(releaseWorkflow, /Install makepkg/); }); test('release workflow skips empty AUR sync commits', () => {