diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index b18cc0b..27f860e 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -96,16 +96,28 @@ jobs: run: poetry publish --repository testpypi --username __token__ --password ${{ secrets.TESTPYPI_API_TOKEN }} build_windows: - name: Build Windows standalone binary + name: Build Windows ${{ matrix.name }} binary if: inputs.CompileWindows needs: publish_preview runs-on: windows-latest + strategy: + fail-fast: false + matrix: + include: + - name: standalone + options: --standalone --remove-output + binary: ./build/cli.dist/phylum-ci.exe + artifact: ./phylum-ci.zip + - name: onefile + options: --onefile --onefile-tempdir-spec="{CACHE_DIR}/{PRODUCT}/{VERSION}" + binary: ./build/phylum-ci.exe + artifact: ./build/phylum-ci.exe steps: - name: Checkout the repo uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - # Nuitka needs the packaged form and not the editable install Poetry provides - # Ref: https://github.com/Nuitka/Nuitka/issues/2965 + # Nuitka needs the packaged form and not the editable install Poetry provides + # Ref: https://github.com/Nuitka/Nuitka/issues/2965 - name: Download build artifacts uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 @@ -132,9 +144,8 @@ jobs: PREVIEW_VER: ${{ needs.publish_preview.outputs.next_ver }} run: | poetry run python -m nuitka ` - --standalone ` + ${{ matrix.options }} ` --output-dir=build ` - --remove-output ` --output-filename="phylum-ci.exe" ` --include-package=phylum ` --include-package-data=phylum ` @@ -153,21 +164,25 @@ jobs: --deployment ` src/phylum/ci/cli.py + # Create the archive here because the confirmation step adds files to the source path + - name: Create zip archive + if: matrix.name == 'standalone' + run: Compress-Archive -Path ./build/cli.dist/* -DestinationPath ${{ matrix.artifact }} + - name: Confirm operation of binary env: PHYLUM_API_KEY: ${{ secrets.PHYLUM_TOKEN }} PHYLUM_BYPASS_CI_DETECTION: true run: | - ./build/cli.dist/phylum-ci.exe -h - ./build/cli.dist/phylum-ci.exe -vvaf - del ./build/cli.dist/phylum/phylum.exe + ${{ matrix.binary }} -h + ${{ matrix.binary }} -vvaf - - name: Upload standalone binary + - name: Upload ${{ matrix.name }} artifact if: always() uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 with: - name: phylum-ci - path: ./build/cli.dist/ + name: phylum-ci-${{ matrix.name }} + path: ${{ matrix.artifact }} if-no-files-found: error - name: Upload compilation report