Skip to content

An open-source cross-platform alternative to AirDrop

test: add exe and cli-exe to release.yml

Tien Do Nam65629aead69a
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index a40860c9..60752ad4 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -376,6 +376,133 @@ jobs:
name: windows-zip-x86-64-result
path: app/LocalSend.zip
+ build_windows_exe_x86_64:
+ needs: build
+ runs-on: windows-latest
+ environment: packaging
+
+ steps:
+ - name: Fix long file paths
+ run: git config --system core.longpaths true
+
+ - name: Checkout repository
+ uses: actions/checkout@v6
+
+ - uses: subosito/flutter-action@v2
+ with:
+ flutter-version: ${{ env.FLUTTER_VERSION }}
+ channel: "stable"
+
+ - name: Build MSIX helper
+ run: '& ''C:\Program Files (x86)\Windows Kits\10\App Certification Kit\makeappx.exe'' pack /o /d support\build\msix /nv /p app\windows\localsend_msix_helper.msix'
+
+ - name: Dependencies
+ working-directory: app
+ run: flutter pub get
+
+ - name: Compile for Windows
+ working-directory: app
+ run: flutter build windows
+
+ - name: Prepare Inno Setup payload
+ run: |
+ New-Item -ItemType Directory -Force -Path "${{ runner.temp }}\inno" | Out-Null
+ Copy-Item -Path "app\build\windows\x64\runner\Release\*" -Destination "${{ runner.temp }}\inno" -Recurse
+ Copy-Item -Path "app\assets\packaging\logo.ico" -Destination "${{ runner.temp }}\inno"
+ Copy-Item -Path "support\build\windows\x64\*" -Destination "${{ runner.temp }}\inno" -Recurse
+ New-Item -ItemType Directory -Force -Path "${{ runner.temp }}\inno-result" | Out-Null
+
+ - name: Compile installer (unsigned)
+ run: iscc /DSkipSignTool "/DPayloadDir=${{ runner.temp }}\inno" "/DResultDir=${{ runner.temp }}\inno-result" support\scripts\compile_windows_exe-inno.iss
+
+ # The SignPath artifact configuration expects "LocalSend-*-windows-x86-64.exe"
+ - name: Rename installer
+ run: Rename-Item -Path "${{ runner.temp }}\inno-result\localsend.exe" -NewName "LocalSend-${{ needs.build.outputs.version }}-windows-x86-64.exe"
+
+ - name: Upload unsigned installer
+ id: unsigned-installer
+ uses: actions/upload-artifact@v6
+ with:
+ name: windows-exe-unsigned
+ path: ${{ runner.temp }}\inno-result\LocalSend-${{ needs.build.outputs.version }}-windows-x86-64.exe
+ if-no-files-found: error
+
+ - name: Sign installer (SignPath)
+ uses: signpath/github-action-submit-signing-request@v2
+ with:
+ api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
+ organization-id: ${{ vars.SIGNPATH_ORG_ID }}
+ project-slug: localsend
+ signing-policy-slug: release-signing
+ artifact-configuration-slug: installer
+ github-artifact-id: ${{ steps.unsigned-installer.outputs.artifact-id }}
+ wait-for-completion: true
+ output-artifact-directory: signed/installer
+
+ - name: Verify signature
+ continue-on-error: true
+ run: |
+ $signtool = Get-ChildItem 'C:\Program Files (x86)\Windows Kits\10\bin\10.*\x64\signtool.exe' | Select-Object -Last 1
+ & $signtool.FullName verify /pa /v "signed\installer\LocalSend-${{ needs.build.outputs.version }}-windows-x86-64.exe"
+
+ - name: Upload signed installer
+ uses: actions/upload-artifact@v6
+ with:
+ name: windows-exe-x86-64-result
+ path: signed/installer/LocalSend-${{ needs.build.outputs.version }}-windows-x86-64.exe
+
+ build_cli_windows_exe_x86_64:
+ needs: build
+ runs-on: windows-latest
+ environment: packaging
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v6
+
+ # cli/ uses edition 2024; the preinstalled toolchain on the runner may be outdated
+ - name: Update Rust
+ run: rustup update stable
+
+ - name: Compile CLI
+ run: cargo build --release --package localsend-cli
+
+ # The SignPath artifact configuration expects "LocalSend-CLI-*-windows-x86-64.exe"
+ - name: Rename CLI executable
+ run: Rename-Item -Path "target\release\localsend-cli.exe" -NewName "LocalSend-CLI-${{ needs.build.outputs.version }}-windows-x86-64.exe"
+
+ - name: Upload unsigned CLI
+ id: unsigned-cli
+ uses: actions/upload-artifact@v6
+ with:
+ name: windows-cli-exe-unsigned
+ path: target\release\LocalSend-CLI-${{ needs.build.outputs.version }}-windows-x86-64.exe
+ if-no-files-found: error
+
+ - name: Sign CLI (SignPath)
+ uses: signpath/github-action-submit-signing-request@v2
+ with:
+ api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
+ organization-id: ${{ vars.SIGNPATH_ORG_ID }}
+ project-slug: localsend
+ signing-policy-slug: release-signing
+ artifact-configuration-slug: cli
+ github-artifact-id: ${{ steps.unsigned-cli.outputs.artifact-id }}
+ wait-for-completion: true
+ output-artifact-directory: signed/cli
+
+ - name: Verify signature
+ continue-on-error: true
+ run: |
+ $signtool = Get-ChildItem 'C:\Program Files (x86)\Windows Kits\10\bin\10.*\x64\signtool.exe' | Select-Object -Last 1
+ & $signtool.FullName verify /pa /v "signed\cli\LocalSend-CLI-${{ needs.build.outputs.version }}-windows-x86-64.exe"
+
+ - name: Upload signed CLI
+ uses: actions/upload-artifact@v6
+ with:
+ name: windows-cli-exe-x86-64-result
+ path: signed/cli/LocalSend-CLI-${{ needs.build.outputs.version }}-windows-x86-64.exe
+
release:
needs:
- build
@@ -386,6 +513,8 @@ jobs:
- build_deb_arm_64
- build_appimage_x86_64
- build_windows_zip_x86_64
+ - build_windows_exe_x86_64
+ - build_cli_windows_exe_x86_64
runs-on: ubuntu-24.04
steps:
@@ -573,3 +702,43 @@ jobs:
asset_path: result.zip
asset_name: LocalSend-${{ needs.build.outputs.version }}-windows-x86-64.zip
asset_content_type: application/zip
+
+ # WINDOWS EXE (x86_64, signed via SignPath)
+ - name: Download windows exe file
+ uses: actions/download-artifact@v7
+ with:
+ name: windows-exe-x86-64-result
+ path: windows-exe-x86-64-result
+
+ - name: Copy exe file to root
+ run: cp windows-exe-x86-64-result/*.exe result.exe
+
+ - name: Upload Release Asset
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ steps.draft_release.outputs.upload_url }}
+ asset_path: result.exe
+ asset_name: LocalSend-${{ needs.build.outputs.version }}-windows-x86-64.exe
+ asset_content_type: application/vnd.microsoft.portable-executable
+
+ # WINDOWS CLI EXE (x86_64, signed via SignPath)
+ - name: Download windows CLI exe file
+ uses: actions/download-artifact@v7
+ with:
+ name: windows-cli-exe-x86-64-result
+ path: windows-cli-exe-x86-64-result
+
+ - name: Copy CLI exe file to root
+ run: cp windows-cli-exe-x86-64-result/*.exe result-cli.exe
+
+ - name: Upload Release Asset
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ steps.draft_release.outputs.upload_url }}
+ asset_path: result-cli.exe
+ asset_name: LocalSend-CLI-${{ needs.build.outputs.version }}-windows-x86-64.exe
+ asset_content_type: application/vnd.microsoft.portable-executable