ci: fix macOS runner and Node 24 deprecation in release workflow #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: Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| 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: python3 -c "import platform; print(platform.machine())" | |
| - name: Build macOS x64 binary | |
| run: python3 build_binaries.py darwin | |
| - 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: python3 -c "import platform; print(platform.machine())" | |
| - name: Build macOS arm64 binary | |
| run: python3 build_binaries.py darwin | |
| - 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 | |
| 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: 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: Install vsce | |
| run: npm install -g @vscode/vsce | |
| - name: Package extension | |
| run: vsce package | |
| - name: Upload GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: '*.vsix' | |
| generate_release_notes: true |