Desktop GUI Release #13
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: Desktop GUI Release | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| on: | |
| push: | |
| tags: | |
| - "gui-v*" | |
| workflow_dispatch: | |
| inputs: | |
| release_tag: | |
| description: "Tag name to publish (example: gui-v1.0.0). If empty, tag is auto-read from project configuration." | |
| required: false | |
| type: string | |
| publish: | |
| description: "Publish GitHub release" | |
| required: false | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-desktop-gui: | |
| name: Build GUI for ${{ matrix.platform }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| platform: windows | |
| artifact-name: lion-vpn-windows | |
| upload-path: cmp/desktopApp/build/compose/binaries/main-release/app/lion-vpn | |
| - os: ubuntu-latest | |
| platform: linux | |
| artifact-name: lion-vpn-linux | |
| upload-path: cmp/desktopApp/build/compose/binaries/main-release/app/lion-vpn | |
| - os: macos-latest | |
| platform: macos | |
| artifact-name: lion-vpn-macos | |
| upload-path: cmp/desktopApp/build/compose/binaries/main-release/app | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: "jetbrains" | |
| java-version: "21" | |
| cache: "gradle" | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: "pip" | |
| - name: Install Python build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements.txt pyinstaller | |
| - name: Bundle Python Executable | |
| shell: bash | |
| working-directory: cmp | |
| run: | | |
| chmod +x gradlew | |
| ./gradlew :desktopApp:bundlePythonExecutable --no-daemon | |
| - name: Build Desktop Application Distributable | |
| shell: bash | |
| working-directory: cmp | |
| run: | | |
| ./gradlew :desktopApp:createReleaseDistributable --no-daemon | |
| - name: Upload Raw Distributable Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact-name }} | |
| path: ${{ matrix.upload-path }} | |
| if-no-files-found: error | |
| publish-gui-release: | |
| name: Publish GUI Release | |
| runs-on: ubuntu-latest | |
| needs: build-desktop-gui | |
| if: always() && !cancelled() && (startsWith(github.ref, 'refs/tags/gui-v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish == 'true')) | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Resolve Release Tag | |
| id: resolve_tag | |
| run: | | |
| if [[ "${{ github.ref }}" == refs/tags/gui-v* ]]; then | |
| TAG_NAME="${{ github.ref_name }}" | |
| elif [[ -n "${{ github.event.inputs.release_tag }}" ]]; then | |
| TAG_NAME="${{ github.event.inputs.release_tag }}" | |
| else | |
| # Extract from cmp/project-config.gradle.kts | |
| VERSION=$(grep 'versionName' cmp/project-config.gradle.kts | cut -d'"' -f2) | |
| TAG_NAME="gui-v$VERSION" | |
| fi | |
| echo "tag_name=$TAG_NAME" >> $GITHUB_OUTPUT | |
| echo "Using release tag: $TAG_NAME" | |
| - name: Download all built artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: final-gui-assets | |
| - name: Prepare and Compress Assets for Release | |
| run: | | |
| mkdir -p release-dist | |
| # Compress Windows | |
| mkdir -p temp-win | |
| mv final-gui-assets/lion-vpn-windows temp-win/lion-vpn | |
| cd temp-win | |
| zip -r ../release-dist/lion-vpn-windows.zip lion-vpn | |
| cd .. | |
| rm -rf temp-win | |
| # Compress Linux | |
| mkdir -p temp-linux | |
| mv final-gui-assets/lion-vpn-linux temp-linux/lion-vpn | |
| cd temp-linux | |
| tar -czf ../release-dist/lion-vpn-linux.tar.gz lion-vpn | |
| cd .. | |
| rm -rf temp-linux | |
| # Compress macOS | |
| cd final-gui-assets/lion-vpn-macos | |
| zip -r -y ../../release-dist/lion-vpn-macos.zip lion-vpn.app | |
| cd ../.. | |
| echo "Compressed release files:" | |
| ls -lah release-dist | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.resolve_tag.outputs.tag_name }} | |
| files: release-dist/* | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: false | |
| name: "GUI Release ${{ steps.resolve_tag.outputs.tag_name }}" |