From e9b9e96421ee533a8853fd27124c318a5812bc8f Mon Sep 17 00:00:00 2001 From: Chris Huber Date: Sat, 16 May 2026 09:04:26 -0400 Subject: [PATCH] ci: move release-asset build to release.published trigger MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The homeboy.yml build-release-asset job gated on needs.homeboy.outputs.released == 'true', but the homeboy-action ci.yml reusable workflow only exposes a 'matrix' output, not 'released' or 'release-tag'. The gate evaluated to false on every release run and the ZIP never published. This moves the asset build to its own workflow file that fires on the release.published event. The release event tag flows through github.event.release.tag_name without depending on the CI workflow's outputs. Also adds a workflow_dispatch input so an existing release tag can be (re)built and uploaded by hand — useful for backfilling v0.116.0 which released after the previous PR landed but never got a ZIP. --- .github/workflows/homeboy.yml | 60 ---------------------- .github/workflows/release-asset.yml | 79 +++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 60 deletions(-) create mode 100644 .github/workflows/release-asset.yml diff --git a/.github/workflows/homeboy.yml b/.github/workflows/homeboy.yml index d1989e2ae..44e4439aa 100644 --- a/.github/workflows/homeboy.yml +++ b/.github/workflows/homeboy.yml @@ -25,63 +25,3 @@ jobs: expected-commands: audit,lint,test autofix: 'false' secrets: inherit - - build-release-asset: - if: needs.homeboy.outputs.released == 'true' - needs: [homeboy] - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ needs.homeboy.outputs.release-tag }} - - - uses: shivammathur/setup-php@v2 - with: - php-version: '8.3' - tools: composer:v2 - - - uses: actions/setup-node@v4 - with: - node-version: '20' - cache: npm - - - run: composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction - - run: npm ci - - run: npm run build - - - name: Build plugin ZIP - run: | - mkdir -p dist/data-machine - rsync -a ./ dist/data-machine/ \ - --exclude='.git' \ - --exclude='.github' \ - --exclude='.claude' \ - --exclude='.datamachine' \ - --exclude='AGENTS.md' \ - --exclude='dist' \ - --exclude='docs' \ - --exclude='node_modules' \ - --exclude='tests' \ - --exclude='.buildignore' \ - --exclude='*.zip' \ - --exclude='*.tar.gz' \ - --exclude='*.log' \ - --exclude='*.tmp' \ - --exclude='*.temp' \ - --exclude='*.cache' \ - --exclude='*.bak' \ - --exclude='*.backup' \ - --exclude='package-lock.json' \ - --exclude='package.json' \ - --exclude='webpack.config.js' \ - --exclude='jsconfig.json' \ - --exclude='phpstan-baseline.neon' \ - --exclude='phpunit.xml*' - cd dist - zip -r data-machine.zip data-machine - - - run: gh release upload "${{ needs.homeboy.outputs.release-tag }}" dist/data-machine.zip --clobber - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-asset.yml b/.github/workflows/release-asset.yml new file mode 100644 index 000000000..04062bbdc --- /dev/null +++ b/.github/workflows/release-asset.yml @@ -0,0 +1,79 @@ +name: Release asset + +on: + release: + types: [published] + workflow_dispatch: + inputs: + tag: + description: 'Existing release tag to (re)build and upload an asset for.' + required: true + +permissions: + contents: write + +jobs: + build-release-asset: + runs-on: ubuntu-latest + steps: + - name: Resolve release tag + id: tag + run: | + if [ -n "${{ github.event.release.tag_name }}" ]; then + echo "tag=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT" + else + echo "tag=${{ github.event.inputs.tag }}" >> "$GITHUB_OUTPUT" + fi + + - uses: actions/checkout@v4 + with: + ref: ${{ steps.tag.outputs.tag }} + + - uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + tools: composer:v2 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + cache: npm + + - run: composer install --no-dev --optimize-autoloader --prefer-dist --no-interaction + - run: npm ci + - run: npm run build + + - name: Build plugin ZIP + run: | + mkdir -p dist/data-machine + rsync -a ./ dist/data-machine/ \ + --exclude='.git' \ + --exclude='.github' \ + --exclude='.claude' \ + --exclude='.datamachine' \ + --exclude='AGENTS.md' \ + --exclude='dist' \ + --exclude='docs' \ + --exclude='node_modules' \ + --exclude='tests' \ + --exclude='.buildignore' \ + --exclude='*.zip' \ + --exclude='*.tar.gz' \ + --exclude='*.log' \ + --exclude='*.tmp' \ + --exclude='*.temp' \ + --exclude='*.cache' \ + --exclude='*.bak' \ + --exclude='*.backup' \ + --exclude='package-lock.json' \ + --exclude='package.json' \ + --exclude='webpack.config.js' \ + --exclude='jsconfig.json' \ + --exclude='phpstan-baseline.neon' \ + --exclude='phpunit.xml*' + cd dist + zip -r data-machine.zip data-machine + + - run: gh release upload "${{ steps.tag.outputs.tag }}" dist/data-machine.zip --clobber + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}