feat(ui): improve Library panel layout and i18n translations #24
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: Build and Release | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - 'release/**' | ||
| tags: | ||
| - 'v*' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| env: | ||
| NODE_VERSION: '20' | ||
| PNPM_VERSION: '9' | ||
| jobs: | ||
| # ============================================ | ||
| # Lint and Type Check | ||
| # ============================================ | ||
| lint: | ||
| name: Lint & Type Check | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v3 | ||
| with: | ||
| version: ${{ env.PNPM_VERSION }} | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: 'pnpm' | ||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
| - name: Run ESLint | ||
| run: pnpm lint | ||
| - name: Run TypeScript type check | ||
| run: pnpm type-check | ||
| # ============================================ | ||
| # Test | ||
| # ============================================ | ||
| test: | ||
| name: Test | ||
| runs-on: ubuntu-latest | ||
| needs: lint | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v3 | ||
| with: | ||
| version: ${{ env.PNPM_VERSION }} | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: 'pnpm' | ||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
| - name: Run tests | ||
| run: pnpm test --coverage | ||
| env: | ||
| CI: true | ||
| - name: Upload coverage report | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
| files: ./coverage/lcov.info | ||
| fail_ci_if_error: false | ||
| # ============================================ | ||
| # Build for all platforms | ||
| # ============================================ | ||
| build: | ||
| name: Build (${{ matrix.os }}) | ||
| runs-on: ${{ matrix.os }} | ||
| needs: test | ||
| if: github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/main') | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: macos-latest | ||
| platform: mac | ||
| - os: windows-latest | ||
| platform: win | ||
| - os: ubuntu-latest | ||
| platform: linux | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v3 | ||
| with: | ||
| version: ${{ env.PNPM_VERSION }} | ||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ env.NODE_VERSION }} | ||
| cache: 'pnpm' | ||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
| # macOS specific setup | ||
| - name: Setup macOS code signing | ||
| if: matrix.platform == 'mac' | ||
| env: | ||
| APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} | ||
| APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | ||
| APPLE_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} | ||
| run: | | ||
| # Create temporary keychain | ||
| KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | ||
| security create-keychain -p "$APPLE_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | ||
| security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" | ||
| security unlock-keychain -p "$APPLE_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | ||
| # Import certificate | ||
| echo "$APPLE_CERTIFICATE" | base64 --decode > certificate.p12 | ||
| security import certificate.p12 -P "$APPLE_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" | ||
| security list-keychain -d user -s "$KEYCHAIN_PATH" | ||
| # Allow codesign to access keychain | ||
| security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$APPLE_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | ||
| # Windows specific setup | ||
| - name: Setup Windows code signing | ||
| if: matrix.platform == 'win' | ||
| env: | ||
| WIN_CERTIFICATE: ${{ secrets.WIN_CERTIFICATE }} | ||
| run: | | ||
| echo "$env:WIN_CERTIFICATE" > certificate.pfx.base64 | ||
| certutil -decode certificate.pfx.base64 certificate.pfx | ||
| del certificate.pfx.base64 | ||
| # Linux specific setup | ||
| - name: Setup Linux dependencies | ||
| if: matrix.platform == 'linux' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y libgtk-3-0 libnotify4 libnss3 libxss1 libxtst6 xdg-utils libatspi2.0-0 libsecret-1-0 libasound2 | ||
| - name: Build Vite app | ||
| run: pnpm build | ||
| - name: Build Electron app (macOS) | ||
| if: matrix.platform == 'mac' | ||
| run: pnpm electron:build --mac --universal | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| APPLE_ID: ${{ secrets.APPLE_ID }} | ||
| APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | ||
| APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }} | ||
| CSC_LINK: ${{ secrets.APPLE_CERTIFICATE }} | ||
| CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | ||
| - name: Build Electron app (Windows) | ||
| if: matrix.platform == 'win' | ||
| run: pnpm electron:build --win | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| WIN_CSC_LINK: certificate.pfx | ||
| WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CERTIFICATE_PASSWORD }} | ||
| - name: Build Electron app (Linux) | ||
| if: matrix.platform == 'linux' | ||
| run: pnpm electron:build --linux | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Upload artifacts | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: flowmind-${{ matrix.platform }} | ||
| path: | | ||
| dist/*.dmg | ||
| dist/*.zip | ||
| dist/*.exe | ||
| dist/*.msi | ||
| dist/*.AppImage | ||
| dist/*.deb | ||
| dist/*.rpm | ||
| retention-days: 30 | ||
| # ============================================ | ||
| # Release | ||
| # ============================================ | ||
| release: | ||
| name: Create Release | ||
| runs-on: ubuntu-latest | ||
| needs: build | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: artifacts | ||
| - name: List artifacts | ||
| run: find artifacts -type f | ||
| - name: Extract release notes | ||
| id: release_notes | ||
| run: | | ||
| VERSION=${GITHUB_REF#refs/tags/v} | ||
| # Extract changelog for this version | ||
| if [ -f CHANGELOG.md ]; then | ||
| NOTES=$(awk "/^## \[${VERSION}\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md) | ||
| else | ||
| NOTES="Release version ${VERSION}" | ||
| fi | ||
| echo "notes<<EOF" >> $GITHUB_OUTPUT | ||
| echo "$NOTES" >> $GITHUB_OUTPUT | ||
| echo "EOF" >> $GITHUB_OUTPUT | ||
| - name: Create GitHub Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| name: FlowMind ${{ github.ref_name }} | ||
| body: ${{ steps.release_notes.outputs.notes }} | ||
| draft: false | ||
| prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }} | ||
| files: | | ||
| artifacts/**/*.dmg | ||
| artifacts/**/*.zip | ||
| artifacts/**/*.exe | ||
| artifacts/**/*.msi | ||
| artifacts/**/*.AppImage | ||
| artifacts/**/*.deb | ||
| artifacts/**/*.rpm | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| # ============================================ | ||
| # Notify | ||
| # ============================================ | ||
| notify: | ||
| name: Notify | ||
| runs-on: ubuntu-latest | ||
| needs: release | ||
| if: always() && startsWith(github.ref, 'refs/tags/') | ||
| steps: | ||
| - name: Send Slack notification | ||
| if: ${{ secrets.SLACK_WEBHOOK_URL != '' }} | ||
| uses: slackapi/slack-github-action@v1.26.0 | ||
| with: | ||
| payload: | | ||
| { | ||
| "text": "FlowMind ${{ github.ref_name }} has been released!", | ||
| "blocks": [ | ||
| { | ||
| "type": "section", | ||
| "text": { | ||
| "type": "mrkdwn", | ||
| "text": "*FlowMind ${{ github.ref_name }}* has been released!\n<${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}|View Release>" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| env: | ||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
| SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||