-
Notifications
You must be signed in to change notification settings - Fork 9
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
ci: refactor manual deployment CI config into 1 workflow #264
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 don't think it will work in the case of manual workflow because it always needs a
needs: [deploy-git-tag]
job to work first.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.
Great question. I understand how this can be confusing. This CI configuration would still work, but it might be confusing how.
needs
specifies order ofsteps
in the configuration. When a manual deployment is performed, thedeploy-git-tag
will indeed not create a new tag. It will run, see there is no tag needing to be made, then quit.This PR works because of the modified
if
statement which says thatdeploy-sonatype
step needs to wait fordeploy-git-tag
to run first, yes, but it will still run if a git tag is made or the deployment was manual.The iOS SDK has the same
needs
andif
statement as this PR and manual deployments work on that configuration.Here is an example CI run of a manual deployment I did with this CI workflow.
deploy-git-tag
did run and it didn't create a tag. deploy to cocoapods checked out the git tag specified in the manual workflow input form and then proceeded to deploy to cocoapods.Would it help if there were some comments added to the
deploy-sdk.yml
config file explaining this?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.
Thank you for the clarification Levi, I thought
deploy-git-tag
would fail hence leading up todeploy-sonatype
not working. But seems like it triggers and skips and doesn't fail so it will not stop the deployment job from failing.A couple of more things, in the case of manual workflow, if
inputs.existing-git-tag
is empty, it would result in using the ref branch as the source of checkout right? just want to make sure we have the latest version. in the manual script, I would fetch the latest tag in case none was mentioned while dispatching the workflow.Secondly,
This script is dependent on
needs.deploy-git-tag.outputs.new_release_version
but if thedeploy-git-tag
is skipped, would it populate this variable? i wouldn't believe so.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.
Good catch. I did not consider that since the iOS SDK doesn't update the version at compile-time.
Until we can test deployment CI workflows before merging PRs, I think this PR is not worth merging. Some copy/pasted code in the short-term is OK for now. I will close this PR to do the refactor another time.