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
refactor: fcm sample app rich push #309
Conversation
Pull request title looks good 👍! If this pull request gets merged, it will not cause a new release of the software. Example: If this project's latest release version is All merged pull requests will eventually get deployed. But some types of pull requests will trigger a deployment (such as features and bug fixes) while some pull requests will wait to get deployed until a later time. This project uses a special format for pull requests titles. Expand this section to learn more (expand by clicking the ᐅ symbol on the left side of this sentence)...This project uses a special format for pull requests titles. Don't worry, it's easy! This pull request title should be in this format:
If your pull request introduces breaking changes to the code, use this format:
where
Examples:
Need more examples? Want to learn more about this format? Check out the official docs. Note: If your pull request does multiple things such as adding a feature and makes changes to the CI server and fixes some bugs then you might want to consider splitting this pull request up into multiple smaller pull requests. |
19a5534
to
e4c2ba3
Compare
- name: Setup build environment to prepare for building | ||
working-directory: ${{ env.GITHUB_WORKSPACE }} # root directory of source code | ||
run: | | ||
make setup_sample_app app=${{ matrix.sample-app }} | ||
sd CUSTOMERIO_WORKSPACE_SITE_ID ${{ secrets.CUSTOMERIO_WORKSPACE_SITE_ID }} "Apps/${{ matrix.sample-app }}/BuildEnvironment.swift" | ||
sd CUSTOMERIO_WORKSPACE_API_KEY ${{ secrets.CUSTOMERIO_WORKSPACE_API_KEY }} "Apps/${{ matrix.sample-app }}/BuildEnvironment.swift" |
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.
With the challenges, we have faced with sed
or other text-replacing tools in the past. The only thing that really worked for us is adding the complete file as an environment and inserting it. Worked seamless for RH and Ami apps.
Do you see any advantage with this approach rather then just inserting Env file completely?
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 plan to never use sed again, haha! We have indeed faced lots of issues.
I did find a popular sed replacement called sd
which is what we are using here. It seems to be easier to use and doesn't have the macos/linux issues we have always had.
I came up with this solution of text replacement of a file because I encountered problems with creating a whole file as a secret. If you ever change the syntax of that Swift file, you have to update the GH secret and then all commits in your code base up to that point will not compile since the syntax changed. This happened once where Jatin updated the GH secret with a new syntax update and all previous releases would no longer compile.
I think this solution is less fragile to break and is easier to be backwards compatible.
Android has gradle build config files that make this sort of thing easier to do. iOS has something kind od similar (xcconfig files) but those have lots of boilerplate involved and complexity when using with cocoapods. Seems overkill. This is the most simple solution that I could come up with.
No description provided.