Skip to content
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

chore: upload mapping file to s3 (WPB-8774) #3713

Open
wants to merge 33 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
44ec610
chore: upload mapping file to s3
ohassine Dec 5, 2024
f68403e
Merge branch 'develop' into upload-mapping-file-to-s3
ohassine Dec 5, 2024
f3d62b2
chore: upload mapping file to s3
ohassine Dec 5, 2024
85a1a0a
Merge remote-tracking branch 'origin/upload-mapping-file-to-s3' into …
ohassine Dec 5, 2024
6cff69b
chore: upload mapping file to s3
ohassine Dec 5, 2024
e0ec014
chore: fix path
ohassine Dec 5, 2024
4e15baf
chore: capitalized variant
ohassine Dec 9, 2024
fbf7359
chore: capitalized variant
ohassine Dec 9, 2024
ffb4e5f
chore: fix path
ohassine Dec 9, 2024
998b690
chore: fix path
ohassine Dec 9, 2024
7c3a686
chore: skip debug mapping file
ohassine Dec 9, 2024
76d2ed8
chore: skip debug mapping file
ohassine Dec 9, 2024
871da2f
Merge branch 'develop' into upload-mapping-file-to-s3
ohassine Dec 11, 2024
dc5daa6
chore: Extract version and version code from APK filename
ohassine Dec 11, 2024
5166e9c
Merge remote-tracking branch 'origin/upload-mapping-file-to-s3' into …
ohassine Dec 11, 2024
bad77ab
chore: Extract version and version code from APK filename
ohassine Dec 11, 2024
e1c7055
chore: fix path
ohassine Dec 12, 2024
e54dd05
chore: fix path
ohassine Dec 12, 2024
e230941
chore: debugging
ohassine Dec 12, 2024
6fbdc04
chore: debugging
ohassine Dec 12, 2024
70ccfc0
chore: cleanup
ohassine Dec 12, 2024
1051a1a
chore: add build flavor
ohassine Dec 13, 2024
5ea9241
chore: cleanup
ohassine Dec 13, 2024
b2db032
chore: kalium reference
ohassine Dec 13, 2024
3ce7268
Merge branch 'develop' into upload-mapping-file-to-s3
ohassine Dec 13, 2024
b854422
Merge remote-tracking branch 'origin/develop' into upload-mapping-fil…
ohassine Dec 13, 2024
45cb2f7
chore: kalium reference
ohassine Dec 13, 2024
417e0b3
Merge remote-tracking branch 'origin/develop' into upload-mapping-fil…
ohassine Dec 30, 2024
4bddc2b
Merge branch 'develop' into upload-mapping-file-to-s3
ohassine Jan 7, 2025
616bd10
Merge branch 'develop' into upload-mapping-file-to-s3
ohassine Jan 7, 2025
a9a8ed5
Merge branch 'develop' into upload-mapping-file-to-s3
ohassine Jan 9, 2025
db16f12
Update .github/actions/deploy-to-s3/action.yml
ohassine Jan 14, 2025
6992b7d
Update .github/actions/deploy-to-s3/action.yml
ohassine Jan 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/actions/deploy-to-s3/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,57 @@ runs:
GITHUB_TOKEN: ${{ inputs.github-token }}
run: |
gh pr comment "${{ github.event.pull_request.number }}" --body "Built [wire-android-${{ inputs.build-flavour }}-${{ inputs.build-variant }}-pr-${{ github.event.pull_request.number }}.apk](${{ steps.upload.outputs.file-url }}) is available for download"
- name: Extract version and version code from APK filename
shell: bash
run: |
filename=${{ steps.path.outputs.apk_full_path }}

# Extract version name and version code
version=$(echo "$filename" | sed -E 's/.*-v([0-9]+\.[0-9]+\.[0-9]+).*/\1/')
version_code=$(echo "$filename" | sed -E 's/.*-([0-9]+)-${{ inputs.build-flavour }}-${{ inputs.build-variant }}\.apk/\1/')

# Print the extracted version and version code
echo "Extracted version: v$version"
echo "Extracted version code: $version_code"

# set them as environment variables for later use
echo "VERSION=v$version" >> $GITHUB_ENV
echo "VERSION_CODE=$version_code" >> $GITHUB_ENV
- name: Rename mapping file
if: ${{ inputs.build-variant != 'debug' }}
shell: bash
id: mapping
run: |
capitalized_variant=$(echo "${{ inputs.build-variant }}" | awk '{print toupper(substr($0,1,1)) tolower(substr($0,2))}')
echo "Capitalized Variant: $capitalized_variant"
mapping_full_path="app/build/outputs/mapping/${{ inputs.build-flavour }}${capitalized_variant}/mapping.txt"
new_mapping_file_name="mapping-${{ env.VERSION }}-${{ env.VERSION_CODE }}-${{ inputs.build-flavour }}-${{ inputs.build-variant }}.txt"
mv "$mapping_full_path" "$new_mapping_file_name"
# Set the new mapping file name as an environment variable
echo "new_mapping_file_name=$new_mapping_file_name" >> $GITHUB_ENV
- name: Upload mapping file to S3 from branch
if: ${{ github.event.pull_request.number == '' && inputs.build-variant != 'debug' }}
id: upload-mapping-from-branch
uses: hkusu/[email protected]
with:
aws-access-key-id: ${{ inputs.aws-access-key-id }}
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: 'eu-central-1'
aws-bucket: ${{ inputs.aws-bucket }}
destination-dir: "megazord/android/reloaded/${{ inputs.build-flavour }}/${{ inputs.build-variant }}/"
file-path: ${{ env.new_mapping_file_name }}
output-file-url: 'false'
public: false
- name: Upload mapping file to S3 from PR
if: ${{ github.event.pull_request.number != '' && inputs.build-variant != 'debug' }}
id: upload-mapping-from-PR
uses: hkusu/[email protected]
with:
aws-access-key-id: ${{ inputs.aws-access-key-id }}
aws-secret-access-key: ${{ inputs.aws-secret-access-key }}
aws-region: 'eu-central-1'
aws-bucket: ${{ inputs.aws-bucket }}
destination-dir: "megazord/android/reloaded/${{ inputs.build-flavour }}/${{ inputs.build-variant }}/PR-${{ github.event.pull_request.number }}/"
file-path: ${{ env.new_mapping_file_name }}
output-file-url: 'false'
public: false
Loading