Skip to content

Conversation

@adamtroiani
Copy link
Contributor

@adamtroiani adamtroiani commented May 15, 2025

Refactor GitHub Actions workflows to use reusable workflow

Changes

  • Created a new reusable workflow build.yml that handles building binaries for all platforms
  • Updated both standard CI and publish workflows to use this reusable workflow

Resolves shop/issues-shopifyvm#291

@adamtroiani adamtroiani self-assigned this May 15, 2025
@adamtroiani adamtroiani requested review from andrewhassan and removed request for jeffcharles May 20, 2025 13:21
Copy link
Contributor

@andrewhassan andrewhassan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this is looking pretty good! I just have a question about the organization of the workflows.

Comment on lines 34 to 42
# Upload all .gz files
find artifacts -name "function-runner-*-${{ inputs.tag_name || github.event.release.tag_name }}.gz" -type f | while read file; do
gh release upload ${{ inputs.tag_name || github.event.release.tag_name }} "$file"
done
# Upload all .gz.sha256 files
find artifacts -name "function-runner-*-${{ inputs.tag_name || github.event.release.tag_name }}.gz.sha256" -type f | while read file; do
gh release upload ${{ inputs.tag_name || github.event.release.tag_name }} "$file"
done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of having to find the artifacts here, which requires knowledge of what the build step is doing internally, I wonder if we could have the build step output the list of the artifacts it generated using output parameters.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I simplified the asset upload process so that it doesn't use find artifacts anymore and instead simply looks at the artifacts directory. Let me know if the use of output parameters is still necessary.

Copy link
Contributor

@adampetro adampetro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great, just have one question

Comment on lines 71 to 81
- name: Archive assets
run: gzip -k -f ${{ matrix.path }} && mv ${{ matrix.path }}.gz ${{ matrix.asset_name }}.gz

- name: Upload assets to artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.asset_name }}.gz
path: ${{ matrix.asset_name }}.gz

- name: Generate asset hash
run: ${{ matrix.shasum_cmd }} ${{ matrix.asset_name }}.gz | awk '{ print $1 }' > ${{ matrix.asset_name }}.gz.sha256
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the condition would apply to these steps too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you're right - just added the condition to those steps as well

@adamtroiani adamtroiani requested a review from adampetro June 2, 2025 20:35
Copy link
Contributor

@adampetro adampetro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Can you squash down the commits into one before/during merging?

@adamtroiani adamtroiani merged commit a17461e into main Jun 3, 2025
10 checks passed
@adamtroiani adamtroiani deleted the multi-platform-build-ci branch June 3, 2025 14:16
@jeffcharles jeffcharles mentioned this pull request Sep 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants