ci(desktop): produce macOS .dmg and Windows NSIS installer #2
Workflow file for this run
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 Release | |
| on: | |
| push: | |
| tags: | |
| - 'desktop-v*' | |
| # Serialize so two tag pushes can't race the same GitHub release. | |
| concurrency: | |
| group: desktop-release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| build-macos: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| # Wails needs the Darwin LC_UUID fix from Go 1.24+. | |
| go-version: '1.24' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Wails | |
| run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
| - name: Add GOPATH/bin to PATH | |
| run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | |
| - name: Build .app | |
| working-directory: desktop | |
| run: wails build -platform darwin/universal -clean | |
| - name: Build .dmg | |
| run: | | |
| mkdir -p dmg-staging | |
| cp -R desktop/build/bin/csvops-desktop.app dmg-staging/ | |
| ln -s /Applications dmg-staging/Applications | |
| hdiutil create \ | |
| -volname "csvops" \ | |
| -srcfolder dmg-staging \ | |
| -ov -format UDZO \ | |
| csvops-desktop-macos-universal.dmg | |
| - name: Also produce a plain zip | |
| run: | | |
| cd desktop/build/bin && zip -r ../../../csvops-desktop-macos-universal.zip csvops-desktop.app | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos | |
| path: | | |
| csvops-desktop-macos-universal.dmg | |
| csvops-desktop-macos-universal.zip | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install Wails | |
| run: go install github.com/wailsapp/wails/v2/cmd/wails@latest | |
| shell: bash | |
| - name: Add GOPATH/bin to PATH | |
| run: echo "$(go env GOPATH)\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| shell: pwsh | |
| - name: Install NSIS | |
| run: choco install -y nsis | |
| shell: pwsh | |
| - name: Build .exe + NSIS installer | |
| working-directory: desktop | |
| run: wails build -platform windows/amd64 -clean -nsis | |
| shell: bash | |
| - name: Stage Windows artifacts | |
| shell: bash | |
| run: | | |
| # The plain exe (portable) | |
| powershell Compress-Archive -Path desktop/build/bin/*.exe -DestinationPath csvops-desktop-windows-amd64.zip | |
| # The NSIS installer (created under build/bin/) | |
| if ls desktop/build/bin/*-installer.exe 1> /dev/null 2>&1; then | |
| cp desktop/build/bin/*-installer.exe csvops-desktop-windows-amd64-installer.exe | |
| fi | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows | |
| path: | | |
| csvops-desktop-windows-amd64.zip | |
| csvops-desktop-windows-amd64-installer.exe | |
| if-no-files-found: warn | |
| release: | |
| needs: [build-macos, build-windows] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: dist/* | |
| name: ${{ github.ref_name }} | |
| generate_release_notes: true |