Skip to content

Commit

Permalink
Use a for loop to upload each asset individually
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewGable committed Oct 30, 2024
1 parent 1c4469e commit 4159730
Showing 1 changed file with 32 additions and 20 deletions.
52 changes: 32 additions & 20 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -794,22 +794,28 @@ jobs:
mv ./desktop-staging-sourcemaps-artifact/merged-source-map.js.map ./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map
mv ./web-staging-sourcemaps-artifact/merged-source-map.js.map ./web-staging-sourcemaps-artifact/web-staging-merged-source-map.js.map
# Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension]
- name: Upload artifacts to GitHub Release
continue-on-error: true
run: |
gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber \
./android-sourcemaps-artifact/index.android.bundle.map#android-sourcemap.js.map \
./android-aab-artifact/app-production-release.aab#android.aab \
./android-hybrid-build-artifact/Expensify-release.aab#android-hybrid.aab \
./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map#desktop-staging-sourcemap.js.map \
./desktop-staging-build-artifact/NewExpensify.dmg#desktop-staging-.dmg \
./ios-sourcemaps-artifact/main.jsbundle.map#ios-sourcemap.js.map \
./ios-build-artifact/New\ Expensify.ipa#ios.ipa \
./ios-hybrid-build-artifact/Expensify.ipa#ios-hybrid.ipa \
./web-staging-sourcemaps-artifact/web-staging-sourcemap.js.map#web-staging-sourcemap.js.map \
./web-staging-build-tar-gz-artifact/webBuild.tar.gz#web-staging.tar.gz \
./web-staging-build-zip-artifact/webBuild.zip#web-staging.zip
# Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension]
files=(
"./android-sourcemaps-artifact/index.android.bundle.map#android-sourcemap.js.map"
"./android-aab-artifact/app-production-release.aab#android.aab"
"./android-hybrid-build-artifact/Expensify-release.aab#android-hybrid.aab"
"./desktop-staging-sourcemaps-artifact/desktop-staging-merged-source-map.js.map#desktop-staging-sourcemap.js.map"
"./desktop-staging-build-artifact/NewExpensify.dmg#desktop-staging.dmg"
"./ios-sourcemaps-artifact/main.jsbundle.map#ios-sourcemap.js.map"
"./ios-build-artifact/New Expensify.ipa#ios.ipa"
"./ios-hybrid-build-artifact/Expensify.ipa#ios-hybrid.ipa"
"./web-staging-sourcemaps-artifact/web-staging-sourcemap.js.map#web-staging-sourcemap.js.map"
"./web-staging-build-tar-gz-artifact/webBuild.tar.gz#web-staging.tar.gz"
"./web-staging-build-zip-artifact/webBuild.zip#web-staging.zip"
)
# Loop through each file and upload individually (so if one fails, we still have other platforms uploaded)
for file_entry in "${files[@]}"; do
gh release upload "$APP_VERSION" --repo "$GITHUB_REPOSITORY" --clobber "$file_entry"
done
env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down Expand Up @@ -853,16 +859,22 @@ jobs:
mv ./desktop-sourcemaps-artifact/merged-source-map.js.map ./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map
mv ./web-sourcemaps-artifact/merged-source-map.js.map ./web-sourcemaps-artifact/web-merged-source-map.js.map
# Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension]
- name: Upload artifacts to GitHub Release
continue-on-error: true
run: |
gh release upload ${{ needs.prep.outputs.APP_VERSION }} --repo ${{ github.repository }} --clobber \
./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-production-sourcemap.js.map \
./desktop-build-artifact/NewExpensify.dmg#desktop-production.dmg \
./web-sourcemaps-artifact/web-merged-source-map.js.map#web-production-sourcemap.js.map \
./web-build-tar-gz-artifact/webBuild.tar.gz#web-production.tar.gz \
./web-build-zip-artifact/webBuild.zip#web-production.zip
# Release asset name should follow the template: [platform]-[hybrid, staging, production or blank]-[sourcemap or blank].[file extension]
files=(
"./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-production-sourcemap.js.map"
"./desktop-build-artifact/NewExpensify.dmg#desktop-production.dmg"
"./web-sourcemaps-artifact/web-merged-source-map.js.map#web-production-sourcemap.js.map"
"./web-build-tar-gz-artifact/webBuild.tar.gz#web-production.tar.gz"
"./web-build-zip-artifact/webBuild.zip#web-production.zip"
)
# Loop through each file and upload individually (so if one fails, we still have other platforms uploaded)
for file_entry in "${files[@]}"; do
gh release upload "$APP_VERSION" --repo "$GITHUB_REPOSITORY" --clobber "$file_entry"
done
env:
GITHUB_TOKEN: ${{ github.token }}

Expand Down

0 comments on commit 4159730

Please sign in to comment.