-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reusable workflow for publishing service artifacts #94
Add reusable workflow for publishing service artifacts #94
Conversation
if: ${{ github.actor == 'OWNER' || github.actor == 'turkenf' || contains(github.event.repository.collaborators, github.actor) }} | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not with this initial PR but as a next step, we should consider parallelizing using a matrix strategy.
jobs:
package_matrix:
strategy:
matrix:
subpackage: [config, ec2, rds] # consider calculating this from sub packages input.
arch: [amd64, arm64]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we had better also give this a try @turkenf. The disadvantage might be the initial setup needed for running these jobs that are normally be shared by the build process (such as buildx setup, caching, vendoring, etc.) will be duplicated. But we may find a way to share this step between the jobs generated by the matrix strategy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the idea of triggering the publish-service-artifacts
job via the gh
tool.
963b5e1
to
9b9d952
Compare
9b9d952
to
4d6a5a1
Compare
4d6a5a1
to
1f4de98
Compare
1f4de98
to
c766dd1
Compare
workflow_call: | ||
inputs: | ||
subpackages: | ||
description: 'Subpackages to be built individually (e.g. monolith config ec2)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value could be monolith
.
|
||
on: | ||
workflow_call: | ||
inputs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please also add the following input parameters to this workflow?
version
: Required, no default (ideally we would like to makeversion
optional and only set theVERSION
make variable if theversion
Github workflow input parameter is specified but we can do this in a follow-up PR). Again we need to set theVERSION
make variable in bothPublish Artifacts
&Build Artifacts
steps. An example value for the description could be:v0.1.0
.
|
||
- name: Publish Artifacts | ||
run: | | ||
make -j ${{ steps.build_artifacts.outputs.num_packages }} SUBPACKAGES="${{ inputs.subpackages }}" publish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please hardcode the following so that we only build & push for the release candidates organization?
We had better hardcode the following make variables in Publish Artifacts
& Build Artifacts
steps: make -j $num_packages SUBPACKAGES="${{ inputs.subpackages }}" XPKG_REG_ORGS=xpkg.upbound.io/upbound-release-candidates XPKG_REG_ORGS_NO_PROMOTE=upbound-release-candidates build.all
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
- name: Publish Artifacts | ||
run: | | ||
make -j ${{ steps.build_artifacts.outputs.num_packages }} SUBPACKAGES="${{ inputs.subpackages }}" XPKG_REG_ORGS=xpkg.upbound.io/upbound-release-candidates XPKG_REG_ORGS_NO_PROMOTE =xpkg.upbound.io/upbound-release-candidates VERSION=${{ inputs.version }} publish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make -j ${{ steps.build_artifacts.outputs.num_packages }} SUBPACKAGES="${{ inputs.subpackages }}" XPKG_REG_ORGS=xpkg.upbound.io/upbound-release-candidates XPKG_REG_ORGS_NO_PROMOTE =xpkg.upbound.io/upbound-release-candidates VERSION=${{ inputs.version }} publish | |
make -j ${{ steps.build_artifacts.outputs.num_packages }} SUBPACKAGES="${{ inputs.subpackages }}" XPKG_REG_ORGS=xpkg.upbound.io/upbound-release-candidates XPKG_REG_ORGS_NO_PROMOTE=xpkg.upbound.io/upbound-release-candidates VERSION=${{ inputs.version }} publish |
if [ $num_packages -gt 10 ]; then | ||
num_packages=10 | ||
fi | ||
make -j $num_packages SUBPACKAGES="${{ inputs.subpackages }}" XPKG_REG_ORGS=xpkg.upbound.io/upbound-release-candidates XPKG_REG_ORGS_NO_PROMOTE =xpkg.upbound.io/upbound-release-candidates VERSION=${{ inputs.version }} build.all |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make -j $num_packages SUBPACKAGES="${{ inputs.subpackages }}" XPKG_REG_ORGS=xpkg.upbound.io/upbound-release-candidates XPKG_REG_ORGS_NO_PROMOTE =xpkg.upbound.io/upbound-release-candidates VERSION=${{ inputs.version }} build.all | |
make -j $num_packages SUBPACKAGES="${{ inputs.subpackages }}" XPKG_REG_ORGS=xpkg.upbound.io/upbound-release-candidates XPKG_REG_ORGS_NO_PROMOTE=xpkg.upbound.io/upbound-release-candidates VERSION=${{ inputs.version }} build.all |
35cde7d
to
3948f2f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @turkenf, lgtm.
Description of your changes
This PR adds a reusable workflow to be reused by official provider repositories for publishing service artifacts.
I have:
make reviewable test
to ensure this PR is ready for review.How has this code been tested
Manually tested on
turkenf/uptest
andturkenf/provider-azure