更新到2.5.5 #9
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-15-intel | |
| 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: | | |
| echo "=== python ===" | |
| which python || true | |
| python -c "import platform; machine = platform.machine(); print(machine); assert machine == 'x86_64', f'Expected x86_64, got {machine}'" | |
| echo "=== python3 ===" | |
| which python3 || true | |
| python3 -c "import platform; machine = platform.machine(); print(machine); assert machine == 'x86_64', f'Expected x86_64, got {machine}'" | |
| - name: Build macOS x64 binary | |
| run: python build_binaries.py darwin x86_64 | |
| - name: Inspect binary | |
| run: | | |
| file bin/darwin/docugenius-cli | |
| lipo -archs bin/darwin/docugenius-cli | grep -x 'x86_64' | |
| - 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-15 | |
| 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; machine = platform.machine(); print(machine); assert machine == 'arm64', f'Expected arm64, got {machine}'" | |
| - name: Build macOS arm64 binary | |
| run: python3 build_binaries.py darwin arm64 | |
| - name: Inspect binary | |
| run: | | |
| file bin/darwin/docugenius-cli | |
| lipo -archs bin/darwin/docugenius-cli | grep -x 'arm64' | |
| - 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-15 | |
| 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: ${{ runner.temp }}/darwin-x64/ | |
| - name: Download macOS arm64 binary | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: darwin-arm64 | |
| path: ${{ runner.temp }}/darwin-arm64/ | |
| - name: Inspect downloaded artifacts | |
| run: | | |
| ls -la "${RUNNER_TEMP}/darwin-x64/" | |
| ls -la "${RUNNER_TEMP}/darwin-arm64/" | |
| file "${RUNNER_TEMP}/darwin-x64/docugenius-cli" || true | |
| file "${RUNNER_TEMP}/darwin-arm64/docugenius-cli" || true | |
| lipo -archs "${RUNNER_TEMP}/darwin-x64/docugenius-cli" | |
| lipo -archs "${RUNNER_TEMP}/darwin-arm64/docugenius-cli" | |
| - name: Create macOS universal binary | |
| run: | | |
| mkdir -p bin/darwin | |
| lipo -create "${RUNNER_TEMP}/darwin-x64/docugenius-cli" "${RUNNER_TEMP}/darwin-arm64/docugenius-cli" -output bin/darwin/docugenius-cli | |
| chmod +x bin/darwin/docugenius-cli | |
| file bin/darwin/docugenius-cli | |
| lipo -archs bin/darwin/docugenius-cli | grep -E '^(x86_64 arm64|arm64 x86_64)$' | |
| rm -rf bin/darwin-x64 bin/darwin-arm64 | |
| - 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 |