Skip to content

Commit

Permalink
feat: Add sha256 in CI for C builds - WPB-11313 (#2269)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterinaWire authored Dec 18, 2024
1 parent f904ea8 commit d880595
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/_reusable_app_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,17 @@ jobs:
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
text: "**${{ env.APP_NAME }}** (version: ${{ env.BUILD_VERSION }} build: ${{ env.BUILD_NUMBER }}) is ready to test 🚀\n**COUNTLY_ENABLED:** ${{ env.ENABLE_COUNTLY }}\n**DATADOG_ENABLED:** ${{ env.ENABLE_DATADOG }}\n**CHANGELOG:** ${{ needs.changelog.outputs.changelog-url }}\n**Tap on iOS device to install:** ${{ env.BUILD_INSTALL_LINK }}\n**AWS S3 Paths:**\n`${{ steps.base64-decoded-S3_PATHS.outputs.decoded }}`\n**Triggered by:** ${{ github.triggering_actor }}\n**Build log:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}\n"
text: |
**${{ env.APP_NAME }}** (version: ${{ env.BUILD_VERSION }} build: ${{ env.BUILD_NUMBER }}) is ready to test 🚀
**COUNTLY_ENABLED:** ${{ env.ENABLE_COUNTLY }}
**DATADOG_ENABLED:** ${{ env.ENABLE_DATADOG }}
**CHANGELOG:** ${{ needs.changelog.outputs.changelog-url }}
**Tap on iOS device to install:** ${{ env.BUILD_INSTALL_LINK }}
**AWS S3 Paths:**
`${{ steps.base64-decoded-S3_PATHS.outputs.decoded }}`
**Triggered by:** ${{ github.triggering_actor }}
**Build log:** ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
**SHA256:** ${{ env.BUILD_SHA256 }}
- name: Notify on Wire if failed
if: failure()
uses: 8398a7/action-slack@v3
Expand Down
16 changes: 12 additions & 4 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,10 @@ platform :ios do
app_name = build.app_center_app_name
end


sh "echo SHA of IPA is:"
sh "shasum -a 256 ../#{build.artifact_path(with_filename: true)}.ipa || true"
# Calculate SHA-256 for the local IPA file
ipa_path = "../#{build.artifact_path(with_filename: true)}.ipa"
sha256 = `shasum -a 256 #{ipa_path} | awk '{print $1}'`.strip
UI.message("SHA-256 of IPA is: #{sha256}")

appcenter_upload(
api_token: ENV["APPCENTER_API_TOKEN"],
Expand All @@ -643,7 +644,14 @@ platform :ios do
)

appcenter_build_info = Fastlane::Actions.lane_context[:APPCENTER_BUILD_INFORMATION]
`export TEMP='BUILD_INSTALL_LINK=#{appcenter_build_info['install_url']}' && echo $TEMP >> ./.post_build/.env`
install_url = appcenter_build_info['install_url']

# Export SHA-256 and INSTALL_LINK to .post_build/.env file
export_env_path = "./.post_build/.env"
FileUtils.mkdir_p("./.post_build")

sh "export TEMP='BUILD_INSTALL_LINK=#{install_url}' && echo $TEMP >> #{export_env_path}"
sh "export TEMP='BUILD_SHA256=#{sha256}' && echo $TEMP >> #{export_env_path}"
end

# Upload to S3 (Automation builds)
Expand Down

0 comments on commit d880595

Please sign in to comment.