diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 1f68139..e35bcc7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -44,7 +44,7 @@ jobs: path: build/automate.phar static-binary: - name: Build static binary ${{ matrix.os }} ${{ matrix.arch }} + name: Build static binary ${{ matrix.filename }} if: github.event_name == 'release' needs: [ phar ] strategy: @@ -54,13 +54,18 @@ jobs: # Linux amd64 - runs_on: ubuntu-latest spc_binary: https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-linux-x86_64 - os: linux - arch: amd64 + build_options: --build-micro --with-upx-pack + filename: automate-linux-amd64 # MacOS amd64 - runs_on: macos-latest spc_binary: https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-x86_64 - os: darwin - arch: amd64 + build_options: --build-micro + filename: automate-darwin-amd64 + # MacOS arm64 + - runs_on: macos-14 + spc_binary: https://dl.static-php.dev/static-php-cli/spc-bin/nightly/spc-macos-aarch64 + build_options: --build-micro + filename: automate-darwin-arm64 runs-on: ${{ matrix.runs_on }} steps: @@ -86,20 +91,25 @@ jobs: run: | bin/spc doctor --auto-fix + - name: Install UPX package + if: ${{ contains(matrix.build_options, 'upx') }} + run: | + bin/spc install-pkg upx + - name: Build static binary run: | - bin/spc download --for-extensions="dom,gmp,openssl,phar,sodium,xml,xmlwriter" - bin/spc build "dom,gmp,openssl,phar,sodium,xml,xmlwriter" --build-micro - bin/spc micro:combine build/automate.phar --output build/automate-${{ matrix.os }}-${{ matrix.arch }} + bin/spc download --for-extensions="dom,gmp,openssl,phar,sodium,xml,xmlwriter" --with-php=8.3 + bin/spc build "dom,gmp,openssl,phar,sodium,xml,xmlwriter" ${{ matrix.build_options }} + bin/spc micro:combine build/automate.phar --output build/${{ matrix.filename }} - name: Ensure the static binary works - run: build/automate-${{ matrix.os }}-${{ matrix.arch }} --version + run: build/${{ matrix.filename }} --version - uses: actions/upload-artifact@v4 name: Upload the static binary artifact with: - name: automate-${{ matrix.os }}-${{ matrix.arch }} - path: build/automate-${{ matrix.os }}-${{ matrix.arch }} + name: ${{ matrix.filename }} + path: build/${{ matrix.filename }} release: name: Upload artifacts to the release