From 9ef2b246f3fbca01733ef398e8bcd268014ee54b Mon Sep 17 00:00:00 2001 From: Fabio Bonelli Date: Sun, 30 Nov 2025 17:01:50 +0100 Subject: [PATCH] chore(ci): test fix for release workflow --- .github/workflows/packagist.yml | 71 ++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 24 deletions(-) diff --git a/.github/workflows/packagist.yml b/.github/workflows/packagist.yml index 995a2a4..b2b2dc3 100644 --- a/.github/workflows/packagist.yml +++ b/.github/workflows/packagist.yml @@ -7,49 +7,72 @@ permissions: contents: write jobs: - update: - runs-on: ubuntu-latest + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-24.04 + platform: linux-amd64 + - os: ubuntu-24.04-arm + platform: linux-arm64 + - os: macos-latest + platform: darwin-arm64 + + name: Build on ${{ matrix.platform }} steps: - - uses: actions/checkout@v6 + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 with: - ref: main + php-version: "8.3" - - uses: shivammathur/setup-php@v2 - - uses: actions/setup-go@v6 + - name: Setup Go + uses: actions/setup-go@v6 with: go-version: "1.24" - - name: Install cross-compilation tools - run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu + - name: Build shared library for platform + run: make build-${{ matrix.platform }} - - name: Build shared libraries for all platforms - run: | - # Build Linux AMD64 (native) - make build-linux-amd64 + - uses: actions/upload-artifact@v4 + with: + name: lib-${{ matrix.platform }} + path: lib/libpubliccode-parser-${{ matrix.platform }}.* - # Build Linux ARM64 (cross-compile) - make build-linux-arm64 + update: + runs-on: ubuntu-latest - # Build macOS Apple Silicon (cross-compile) - make build-darwin-arm64 + steps: + - uses: actions/checkout@v6 + with: + ref: main + + - uses: actions/download-artifact@v4 + with: + merge-multiple: true + path: lib/ - run: | + ls lib/ if ! git diff --quiet -- lib/; then git config user.name "${GITHUB_ACTOR}" git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" git add lib/ git commit -m "ci: update shared libraries [skip ci]" - git push + git show + # git push else echo "No changes in lib/" fi - - name: Update Packagist - run: | - curl -XPOST -H'content-type:application/json' \ - "https://packagist.org/api/update-package?username=bfabio&apiToken=${{ secrets.PACKAGIST_API_TOKEN }}" \ - -d'{"repository":{"url":"https://github.com/bfabio/publiccode-parser-php"}}' + # - name: Update Packagist + # run: | + # curl -XPOST -H'content-type:application/json' \ + # "https://packagist.org/api/update-package?username=bfabio&apiToken=${{ secrets.PACKAGIST_API_TOKEN }}" \ + # -d'{"repository":{"url":"https://github.com/bfabio/publiccode-parser-php"}}'