fix: use sys.executable in build_binaries.py to ensure correct arch #4
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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-macos-x64: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rosetta 2 | |
| run: /usr/sbin/softwareupdate --install-rosetta --agree-to-license || true | |
| - name: Set up Python (x64) | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| architecture: x64 | |
| - name: Verify Python architecture | |
| run: | | |
| which python3 | |
| python3 -c "import platform; print(platform.machine())" | |
| - name: Build macOS x64 binary | |
| run: python3 build_binaries.py darwin | |
| - name: Inspect binary | |
| run: file bin/darwin/docugenius-cli | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: darwin-x64 | |
| path: bin/darwin/docugenius-cli | |
| retention-days: 1 | |
| build-macos-arm64: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Verify Python architecture | |
| run: | | |
| which python3 | |
| python3 -c "import platform; print(platform.machine())" | |
| - name: Build macOS arm64 binary | |
| run: python3 build_binaries.py darwin | |
| - name: Inspect binary | |
| run: file bin/darwin/docugenius-cli | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: darwin-arm64 | |
| path: bin/darwin/docugenius-cli | |
| retention-days: 1 | |
| package-and-release: | |
| needs: [build-macos-x64, build-macos-arm64] | |
| runs-on: macos-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set up Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Compile | |
| run: npm run compile | |
| - name: Download macOS x64 binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: darwin-x64 | |
| path: bin/darwin-x64/ | |
| - name: Download macOS arm64 binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: darwin-arm64 | |
| path: bin/darwin-arm64/ | |
| - name: Inspect downloaded artifacts | |
| run: | | |
| ls -la bin/darwin-x64/ | |
| ls -la bin/darwin-arm64/ | |
| file bin/darwin-x64/docugenius-cli || true | |
| file bin/darwin-arm64/docugenius-cli || true | |
| - name: Create macOS universal binary | |
| run: | | |
| mkdir -p bin/darwin | |
| lipo -create bin/darwin-x64/docugenius-cli bin/darwin-arm64/docugenius-cli -output bin/darwin/docugenius-cli | |
| chmod +x bin/darwin/docugenius-cli | |
| file bin/darwin/docugenius-cli | |
| - name: Verify Windows batch script exists | |
| run: test -f bin/win32/docugenius-cli.bat | |
| - name: Package extension | |
| run: npx vsce package | |
| - name: List artifacts | |
| run: ls -la *.vsix | |
| - name: Upload GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: '*.vsix' | |
| generate_release_notes: true |