fix: Highlight 'Home' nav item by default #114
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 WinBoat | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| build_type: | |
| description: "Build type" | |
| required: true | |
| default: "all" | |
| type: choice | |
| options: | |
| - all | |
| - linux-only | |
| - guest-server-only | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: >- | |
| (github.event_name == 'push' && !startsWith(github.ref, 'refs/tags/')) || | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.build_type != 'guest-server-only') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Show build type | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "Manual workflow triggered with build type: ${{ github.event.inputs.build_type }}" | |
| else | |
| echo "Automatic workflow triggered by ${{ github.event_name }}" | |
| fi | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "stable" | |
| cache-dependency-path: "guest_server/go.sum" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build guest server and app | |
| run: npm run build:linux-gs | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Derive artifact naming | |
| id: meta | |
| shell: bash | |
| run: | | |
| node -e "const p=require('./package.json'); console.log('NAME='+p.name)" >> "$GITHUB_OUTPUT" | |
| node -e "const p=require('./package.json'); console.log('VERSION='+p.version)" >> "$GITHUB_OUTPUT" | |
| ARCH_FROM_FILE=$(ls dist/*.{AppImage,deb,rpm,tar.gz} 2>/dev/null | head -n1 | xargs -I{} basename {} | sed -E 's/.*-([A-Za-z0-9_]+)\.[^.]+$/\1/') | |
| if [ -n "$ARCH_FROM_FILE" ]; then | |
| echo "ARCH=$ARCH_FROM_FILE" >> "$GITHUB_OUTPUT" | |
| else | |
| NODE_ARCH=$(node -p "process.arch") | |
| case "$NODE_ARCH" in | |
| x64) echo "ARCH=x86_64" >> "$GITHUB_OUTPUT" ;; | |
| arm64) echo "ARCH=arm64" >> "$GITHUB_OUTPUT" ;; | |
| arm) echo "ARCH=armv7l" >> "$GITHUB_OUTPUT" ;; | |
| *) echo "ARCH=$NODE_ARCH" >> "$GITHUB_OUTPUT" ;; | |
| esac | |
| fi | |
| - name: Upload AppImage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.meta.outputs.NAME }}-${{ steps.meta.outputs.VERSION }}-${{ steps.meta.outputs.ARCH }}.appimage | |
| path: dist/*.AppImage | |
| if-no-files-found: ignore | |
| - name: Upload DEB | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.meta.outputs.NAME }}-${{ steps.meta.outputs.VERSION }}-${{ steps.meta.outputs.ARCH }}.deb | |
| path: dist/*.deb | |
| if-no-files-found: ignore | |
| - name: Upload RPM | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.meta.outputs.NAME }}-${{ steps.meta.outputs.VERSION }}-${{ steps.meta.outputs.ARCH }}.rpm | |
| path: dist/*.rpm | |
| if-no-files-found: ignore | |
| - name: Upload TAR.GZ | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.meta.outputs.NAME }}-${{ steps.meta.outputs.VERSION }}-${{ steps.meta.outputs.ARCH }}.tar.gz | |
| path: dist/*.tar.gz | |
| if-no-files-found: ignore | |
| - name: Upload unpacked directory | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.meta.outputs.NAME }}-${{ steps.meta.outputs.VERSION }}-${{ steps.meta.outputs.ARCH }}-unpacked.zip | |
| path: dist/linux-unpacked/** | |
| if-no-files-found: ignore | |
| - name: Upload guest server zip | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ steps.meta.outputs.NAME }}-${{ steps.meta.outputs.VERSION }}-${{ steps.meta.outputs.ARCH }}-guest_server.zip | |
| path: dist/linux-unpacked/resources/guest_server/winboat_guest_server.zip | |
| if-no-files-found: ignore | |
| # - name: Upload metadata | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: ${{ steps.meta.outputs.NAME }}-${{ steps.meta.outputs.VERSION }}-${{ steps.meta.outputs.ARCH }}-metadata | |
| # path: | | |
| # dist/latest-linux.yml | |
| # dist/linux-unpacked/resources/guest_server/winboat_guest_server.zip | |
| # if-no-files-found: ignore | |
| guest-server-only: | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'workflow_dispatch' && github.event.inputs.build_type == 'guest-server-only' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Show build type | |
| run: | | |
| echo "Manual workflow triggered with build type: guest-server-only" | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "stable" | |
| cache-dependency-path: "guest_server/go.sum" | |
| - name: Build guest server only | |
| run: bash build-guest-server.sh | |
| - name: Upload guest server artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: guest-server-artifacts | |
| path: guest_server/ | |
| release: | |
| runs-on: ubuntu-latest | |
| if: >- | |
| startsWith(github.ref, 'refs/tags/') || | |
| (github.event_name == 'workflow_dispatch' && github.event.inputs.build_type == 'all') | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Show build type | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "Manual workflow triggered with build type: ${{ github.event.inputs.build_type }}" | |
| else | |
| echo "Release workflow triggered by tag: ${{ github.ref_name }}" | |
| fi | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: "npm" | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "stable" | |
| cache-dependency-path: "guest_server/go.sum" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build guest server and app | |
| run: npm run build:linux-gs | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Zip unpacked variant | |
| run: cd dist && zip -r winboat-linux-unpacked.zip linux-unpacked/ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| dist/*.AppImage | |
| dist/*.deb | |
| dist/*.rpm | |
| dist/*.tar.gz | |
| dist/winboat-linux-unpacked.zip | |
| dist/latest-linux.yml | |
| dist/linux-unpacked/resources/guest_server/winboat_guest_server.zip | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |