fix: extend desktop executable path #57
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 | |
| on: | |
| push: | |
| branches: [master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| prepare: | |
| name: Prepare | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| tag_name: ${{ steps.version.outputs.tag_name }} | |
| steps: | |
| - name: Generate version tag | |
| id: version | |
| run: | | |
| raw="$(TZ=Asia/Shanghai date '+%y.%m.%d')" | |
| IFS=. read -r yy mm dd <<< "$raw" | |
| version="$((10#$yy)).$((10#$mm)).$((10#$dd))" | |
| echo "version=$version" >> "$GITHUB_OUTPUT" | |
| echo "tag_name=$version" >> "$GITHUB_OUTPUT" | |
| - name: Delete existing release | |
| run: gh release delete "${{ steps.version.outputs.tag_name }}" --repo "${{ github.repository }}" --yes --cleanup-tag || true | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| macos: | |
| name: Build macOS | |
| needs: prepare | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout desktop | |
| uses: actions/checkout@v4 | |
| with: | |
| path: miya-desktop | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: miya-desktop/go.mod | |
| cache-dependency-path: miya-desktop/go.sum | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| cache-dependency-path: miya-desktop/frontend/package-lock.json | |
| - name: Build | |
| working-directory: miya-desktop | |
| run: | | |
| make build-macos APP_VERSION=${{ needs.prepare.outputs.version }} | |
| make build-macos-arm64 APP_VERSION=${{ needs.prepare.outputs.version }} | |
| - name: Package | |
| working-directory: miya-desktop | |
| run: | | |
| mkdir -p build/artifacts | |
| ditto -c -k --keepParent bin/Miya.app build/artifacts/miya-desktop-${{ needs.prepare.outputs.version }}-darwin-universal.zip | |
| ditto -c -k --keepParent bin/Miya-arm64.app build/artifacts/miya-desktop-${{ needs.prepare.outputs.version }}-darwin-arm64.zip | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-${{ needs.prepare.outputs.version }} | |
| path: miya-desktop/build/artifacts/* | |
| windows: | |
| name: Build Windows | |
| needs: prepare | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout desktop | |
| uses: actions/checkout@v4 | |
| with: | |
| path: miya-desktop | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: miya-desktop/go.mod | |
| cache-dependency-path: miya-desktop/go.sum | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| cache: npm | |
| cache-dependency-path: miya-desktop/frontend/package-lock.json | |
| - name: Build | |
| working-directory: miya-desktop | |
| shell: bash | |
| run: make build-windows APP_VERSION=${{ needs.prepare.outputs.version }} | |
| - name: Package | |
| working-directory: miya-desktop | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path build/artifacts | Out-Null | |
| Compress-Archive -Path bin/miya-desktop.exe -DestinationPath build/artifacts/miya-desktop-${{ needs.prepare.outputs.version }}-windows-amd64.zip -Force | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-${{ needs.prepare.outputs.version }} | |
| path: miya-desktop/build/artifacts/* | |
| release: | |
| name: Create Release | |
| needs: [prepare, macos, windows] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Create release | |
| run: | | |
| mkdir -p release-assets | |
| find . -type f -name 'miya-desktop-*.zip' -exec cp {} release-assets/ \; | |
| (cd release-assets && sha256sum miya-desktop-*.zip > SHA256SUMS) | |
| - name: Publish release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.prepare.outputs.tag_name }} | |
| name: Miya Desktop ${{ needs.prepare.outputs.version }} | |
| prerelease: true | |
| fail_on_unmatched_files: true | |
| files: | | |
| release-assets/* |