fix: resolve PR 877 issues - route params, artifact paths, and build configs

Fix route parameter name in use-initial-theme hook (communityAddress -> boardIdentifier), correct release workflow artifact paths (dist -> out/make), add BUILD_ARCH env var for Linux arm64 builds, fix macOS app name dev check, and update capacitor webDir to match vite output.
This commit is contained in:
plebeius
2026-01-30 14:33:45 +08:00
parent d4f16c707f
commit 50ee10cbc9
4 changed files with 23 additions and 20 deletions
+10 -10
View File
@@ -32,7 +32,7 @@ jobs:
run: yarn install --frozen-lockfile --ignore-engines run: yarn install --frozen-lockfile --ignore-engines
# make sure the ipfs executable is executable # make sure the ipfs executable is executable
- name: Download IPFS and set permissions (with Node v22) - name: Download IPFS and set permissions (with Node v22)
run: node electron/download-ipfs && sudo chmod +x bin/linux/ipfs run: BUILD_ARCH=${{ matrix.arch }} node electron/download-ipfs && sudo chmod +x bin/linux/ipfs
- name: Build React app (with Node v22) - name: Build React app (with Node v22)
run: CI='' NODE_ENV=production yarn build run: CI='' NODE_ENV=production yarn build
- name: Build Electron app for Linux (arm64) - name: Build Electron app for Linux (arm64)
@@ -41,15 +41,15 @@ jobs:
- name: Build Electron app for Linux (x64) - name: Build Electron app for Linux (x64)
if: ${{ matrix.arch == 'x64' }} if: ${{ matrix.arch == 'x64' }}
run: yarn electron:build:linux:x64 run: yarn electron:build:linux:x64
- name: List dist directory - name: List out directory
run: ls dist run: ls -la out/make
# publish version release # publish version release
- name: Generate release body - name: Generate release body
run: node scripts/release-body > release-body.txt run: node scripts/release-body > release-body.txt
- uses: ncipollo/release-action@v1 - uses: ncipollo/release-action@v1
with: with:
artifacts: 'dist/5chan*.AppImage,dist/5chan*-arm64.AppImage,dist/5chan-html*.zip' artifacts: 'out/make/*.AppImage'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
replacesArtifacts: true replacesArtifacts: true
omitBody: true omitBody: true
@@ -104,15 +104,15 @@ jobs:
else else
yarn electron:build:mac:x64 yarn electron:build:mac:x64
fi fi
- name: List dist directory - name: List out directory
run: ls dist run: ls -la out/make
# publish version release # publish version release
- name: Generate release body - name: Generate release body
run: node scripts/release-body > release-body.txt run: node scripts/release-body > release-body.txt
- uses: ncipollo/release-action@v1 - uses: ncipollo/release-action@v1
with: with:
artifacts: 'dist/5chan*.dmg,dist/5chan*-arm64.dmg' artifacts: 'out/make/*.dmg,out/make/*.zip'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
replacesArtifacts: true replacesArtifacts: true
omitBody: true omitBody: true
@@ -138,15 +138,15 @@ jobs:
run: npx cross-env NODE_ENV=production yarn build run: npx cross-env NODE_ENV=production yarn build
- name: Build Electron app for Windows (x64) - name: Build Electron app for Windows (x64)
run: yarn electron:build:windows run: yarn electron:build:windows
- name: List dist directory - name: List out directory
run: dir dist run: dir out\make\squirrel.windows\x64
# publish version release # publish version release
- name: Generate release body - name: Generate release body
run: node scripts/release-body > release-body.txt run: node scripts/release-body > release-body.txt
- uses: ncipollo/release-action@v1 - uses: ncipollo/release-action@v1
with: with:
artifacts: 'dist/5chan*.exe' artifacts: 'out/make/squirrel.windows/x64/*.exe'
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
replacesArtifacts: true replacesArtifacts: true
omitBody: true omitBody: true
+4 -4
View File
@@ -3,13 +3,13 @@ import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { const config: CapacitorConfig = {
appId: 'fivechan.android', appId: 'fivechan.android',
appName: '5chan', appName: '5chan',
webDir: 'dist', webDir: 'build',
plugins: { plugins: {
CapacitorHttp: { CapacitorHttp: {
enabled: true, enabled: true,
}, },
FileUploader: { FileUploader: {
enabled: true enabled: true,
}, },
StatusBar: { StatusBar: {
style: 'Dark', style: 'Dark',
@@ -21,8 +21,8 @@ const config: CapacitorConfig = {
}, },
}, },
server: { server: {
androidScheme: 'https' androidScheme: 'https',
} },
}; };
export default config; export default config;
+1 -1
View File
@@ -319,7 +319,7 @@ const createMainWindow = () => {
app.whenReady().then(() => { app.whenReady().then(() => {
// Set app name and dock icon for development mode on macOS // Set app name and dock icon for development mode on macOS
if (process.platform === 'darwin') { if (process.platform === 'darwin' && isDev) {
app.setName('seedit'); app.setName('seedit');
if (app.dock) { if (app.dock) {
const iconPath = path.join(dirname, '..', isDev ? 'public' : 'build', 'icon.png'); const iconPath = path.join(dirname, '..', isDev ? 'public' : 'build', 'icon.png');
+7 -4
View File
@@ -3,11 +3,12 @@ import { useLocation, useParams } from 'react-router-dom';
import useThemeStore from '../stores/use-theme-store'; import useThemeStore from '../stores/use-theme-store';
import { useDirectories } from './use-directories'; import { useDirectories } from './use-directories';
import { isAllView, isHomeView, isNotFoundView, isPendingPostView, isSubscriptionsView, isModView } from '../lib/utils/view-utils'; import { isAllView, isHomeView, isNotFoundView, isPendingPostView, isSubscriptionsView, isModView } from '../lib/utils/view-utils';
import { getSubplebbitAddress } from '../lib/utils/route-utils';
import { useAccountComment } from '@plebbit/plebbit-react-hooks'; import { useAccountComment } from '@plebbit/plebbit-react-hooks';
const useInitialTheme = (pendingPostSubplebbitAddress?: string) => { const useInitialTheme = (pendingPostSubplebbitAddress?: string) => {
const location = useLocation(); const location = useLocation();
const { communityAddress: paramsSubplebbitAddress, accountCommentIndex } = useParams<{ communityAddress: string; accountCommentIndex?: string }>(); const { boardIdentifier, accountCommentIndex } = useParams<{ boardIdentifier: string; accountCommentIndex?: string }>();
const commentIndex = accountCommentIndex ? parseInt(accountCommentIndex) : undefined; const commentIndex = accountCommentIndex ? parseInt(accountCommentIndex) : undefined;
const pendingPost = useAccountComment({ commentIndex }); const pendingPost = useAccountComment({ commentIndex });
// Subscribe to the actual themes data, not just functions // Subscribe to the actual themes data, not just functions
@@ -21,13 +22,15 @@ const useInitialTheme = (pendingPostSubplebbitAddress?: string) => {
const isInModView = isModView(location.pathname); const isInModView = isModView(location.pathname);
const isInPendingPostView = isPendingPostView(location.pathname, params); const isInPendingPostView = isPendingPostView(location.pathname, params);
const paramsSubplebbitAddress = boardIdentifier ? getSubplebbitAddress(boardIdentifier, directories) : undefined;
const initialTheme = useMemo(() => { const initialTheme = useMemo(() => {
let theme = 'yotsuba'; let theme = 'yotsuba';
if (isInPendingPostView) { if (isInPendingPostView) {
const communityAddress = pendingPostSubplebbitAddress || pendingPost?.communityAddress; const subplebbitAddress = pendingPostSubplebbitAddress || pendingPost?.subplebbitAddress;
if (communityAddress) { if (subplebbitAddress) {
const community = directories.find((s) => s.address === communityAddress); const community = directories.find((s) => s.address === subplebbitAddress);
if (community?.nsfw) { if (community?.nsfw) {
theme = themes.nsfw || 'yotsuba'; theme = themes.nsfw || 'yotsuba';
} else { } else {