feat:修改布局 #26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Test Build (feat/test) | |
| on: | |
| push: | |
| branches: | |
| - "feat/test" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-desktop: | |
| name: Build Desktop (${{ matrix.platform }}) | |
| strategy: | |
| matrix: | |
| include: | |
| - os: macos-latest | |
| platform: mac | |
| command: build:mac | |
| - os: windows-latest | |
| platform: win | |
| command: build:win | |
| - os: ubuntu-latest | |
| platform: linux | |
| command: build:linux | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| run: pnpm install --no-frozen-lockfile | |
| - name: Build Desktop App | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: pnpm --filter @bookdock/desktop run ${{ matrix.command }} | |
| - name: Upload Release Assets (Draft) | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: test-build | |
| name: Test Build (feat/test) | |
| draft: true | |
| files: | | |
| apps/desktop/release/*.dmg | |
| apps/desktop/release/*.zip | |
| apps/desktop/release/*.exe | |
| apps/desktop/release/*.AppImage | |
| apps/desktop/release/*.deb | |
| apps/desktop/release/*.blockmap | |
| apps/desktop/release/latest*.yml | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-android: | |
| name: Build Android | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "zulu" | |
| java-version: "17" | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| run: pnpm install --no-frozen-lockfile | |
| - name: Build Android APK | |
| run: | | |
| cd apps/mobile/android | |
| chmod +x gradlew | |
| ./gradlew assembleRelease | |
| - name: Rename and Prepare APK | |
| id: prepare_apk | |
| run: | | |
| VERSION=$(node -p "require('./apps/mobile/app.json').expo.version") | |
| OLD_PATH="apps/mobile/android/app/build/outputs/apk/release/app-release.apk" | |
| NEW_NAME="BookDock-${VERSION}-test.apk" | |
| NEW_PATH="apps/mobile/android/app/build/outputs/apk/release/${NEW_NAME}" | |
| mv "$OLD_PATH" "$NEW_PATH" | |
| echo "apk_path=$NEW_PATH" >> $GITHUB_OUTPUT | |
| - name: Upload Release Assets (Draft) | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: test-build | |
| name: Test Build (feat/test) | |
| draft: true | |
| files: | | |
| ${{ steps.prepare_apk.outputs.apk_path }} | |
| token: ${{ secrets.GITHUB_TOKEN }} |