-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[No QA] Fix finalizeRelease job #48792
Conversation
Updated |
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.
LGTM
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 found a few more instances of us trying to access environment variables that aren't set. Let's clean this up by using a job output instead, because that provides better intellisense and static analysis than env variables. i.e: trying to access a needs.jobName.outputs.MY_OUTPUT
where the job isn't dependent on jobName
or that job doesn't include a MY_OUTPUT
output, those things would be caught by the schema validator/actionslint
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index 9b1a8db4588..e73558a05b3 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -28,10 +28,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
- createTag:
+ prep:
needs: validateActor
- if: ${{ github.ref == 'refs/heads/staging' }}
+ if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }}
runs-on: ubuntu-latest
+ outputs:
+ APP_VERSION: ${{ steps.getAppVersion.outputs.VERSION }}
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -46,9 +48,14 @@ jobs:
OS_BOTIFY_APP_ID: ${{ secrets.OS_BOTIFY_APP_ID }}
OS_BOTIFY_PRIVATE_KEY: ${{ secrets.OS_BOTIFY_PRIVATE_KEY }}
+ - name: Get app version
+ id: getAppVersion
+ run: echo "VERSION=$(jq -r .version < package.json)" >> "$GITHUB_OUTPUT"
+
- name: Create and push tag
+ if: ${{ github.ref == 'refs/heads/staging' }}
run: |
- git tag "$(jq -r .version < package.json)"
+ git tag ${{ steps.getAppVersion.outputs.VERSION }}
git push origin --tags
# Note: we're updating the checklist before running the deploys and assuming that it will succeed on at least one platform
@@ -56,14 +63,13 @@ jobs:
name: Create or update deploy checklist
uses: ./.github/workflows/createDeployChecklist.yml
if: ${{ github.ref == 'refs/heads/staging' }}
- needs: createTag
+ needs: prep
secrets: inherit
android:
# WARNING: getDeployPullRequestList depends on this job name. do not change job name without adjusting that action accordingly
name: Build and deploy Android
- needs: validateActor
- if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }}
+ needs: prep
runs-on: ubuntu-latest-xl
steps:
- name: Checkout
@@ -96,8 +102,9 @@ jobs:
env:
LARGE_SECRET_PASSPHRASE: ${{ secrets.LARGE_SECRET_PASSPHRASE }}
- - name: Set version in ENV
- run: echo "VERSION_CODE=$(grep -o 'versionCode\s\+[0-9]\+' android/app/build.gradle | awk '{ print $2 }')" >> "$GITHUB_ENV"
+ - name: Get Android native version
+ id: getAndroidVersion
+ run: echo "VERSION_CODE=$(grep -o 'versionCode\s\+[0-9]\+' android/app/build.gradle | awk '{ print $2 }')" >> "$GITHUB_OUTPUTS"
- name: Run Fastlane
run: bundle exec fastlane android ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'beta' }}
@@ -105,7 +112,7 @@ jobs:
RUBYOPT: '-rostruct'
MYAPP_UPLOAD_STORE_PASSWORD: ${{ secrets.MYAPP_UPLOAD_STORE_PASSWORD }}
MYAPP_UPLOAD_KEY_PASSWORD: ${{ secrets.MYAPP_UPLOAD_KEY_PASSWORD }}
- VERSION: ${{ env.VERSION_CODE }}
+ VERSION: ${{ steps.getAndroidVersion.outputs.VERSION_CODE }}
- name: Upload Android build to Browser Stack
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
@@ -141,7 +148,7 @@ jobs:
attachments: [{
color: "#DB4545",
pretext: `<!subteam^S4TJJ3PSL>`,
- text: `💥 Android production deploy failed. Please manually submit ${{ env.VERSION }} in the <https://play.google.com/console/u/0/developers/8765590895836334604/app/4973041797096886180/releases/overview|Google Play Store>. 💥`,
+ text: `💥 Android production deploy failed. Please manually submit ${{ needs.prep.outputs.APP_VERSION }} in the <https://play.google.com/console/u/0/developers/8765590895836334604/app/4973041797096886180/releases/overview|Google Play Store>. 💥`,
}]
}
env:
@@ -151,8 +158,7 @@ jobs:
desktop:
# WARNING: getDeployPullRequestList depends on this job name. do not change job name without adjusting that action accordingly
name: Build and deploy Desktop
- needs: validateActor
- if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }}
+ needs: prep
runs-on: macos-14-large
steps:
- name: Checkout
@@ -197,8 +203,7 @@ jobs:
iOS:
# WARNING: getDeployPullRequestList depends on this job name. do not change job name without adjusting that action accordingly
name: Build and deploy iOS
- needs: validateActor
- if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }}
+ needs: prep
env:
DEVELOPER_DIR: /Applications/Xcode_15.2.0.app/Contents/Developer
runs-on: macos-13-xlarge
@@ -260,8 +265,9 @@ jobs:
- name: Set current App version in Env
run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"
- - name: Set iOS version in ENV
- run: echo "IOS_VERSION=$(echo '${{ env.VERSION }}' | tr '-' '.')" >> "$GITHUB_ENV"
+ - name: Get iOS native version
+ id: getIOSVersion
+ run: echo "IOS_VERSION=$(echo '${{ needs.prep.outputs.APP_VERSION }}' | tr '-' '.')" >> "$GITHUB_ENV"
- name: Run Fastlane
run: bundle exec fastlane ios ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'beta' }}
@@ -270,7 +276,7 @@ jobs:
APPLE_CONTACT_PHONE: ${{ secrets.APPLE_CONTACT_PHONE }}
APPLE_DEMO_EMAIL: ${{ secrets.APPLE_DEMO_EMAIL }}
APPLE_DEMO_PASSWORD: ${{ secrets.APPLE_DEMO_PASSWORD }}
- VERSION: ${{ env.IOS_VERSION }}
+ VERSION: ${{ steps.getIOSVersion.outputs.IOS_VERSION }}
- name: Upload iOS build to Browser Stack
if: ${{ !fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
@@ -303,7 +309,7 @@ jobs:
attachments: [{
color: "#DB4545",
pretext: `<!subteam^S4TJJ3PSL>`,
- text: `💥 iOS production deploy failed. Please manually submit ${{ env.IOS_VERSION }} in the <https://appstoreconnect.apple.com/apps/1530278510/appstore|App Store>. 💥`,
+ text: `💥 iOS production deploy failed. Please manually submit ${{ steps.getIOSVersion.outputs.IOS_VERSION }} in the <https://appstoreconnect.apple.com/apps/1530278510/appstore|App Store>. 💥`,
}]
}
env:
@@ -313,8 +319,7 @@ jobs:
web:
# WARNING: getDeployPullRequestList depends on this job name. do not change job name without adjusting that action accordingly
name: Build and deploy Web
- needs: validateActor
- if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }}
+ needs: prep
runs-on: ubuntu-latest-xl
steps:
- name: Checkout
@@ -371,8 +376,8 @@ jobs:
run: |
sleep 5
DOWNLOADED_VERSION="$(wget -q -O /dev/stdout https://staging.new.expensify.com/version.json | jq -r '.version')"
- if [[ '${{ env.VERSION }}' != "$DOWNLOADED_VERSION" ]]; then
- echo "Error: deployed version $DOWNLOADED_VERSION does not match local version ${{ env.VERSION }}. Something went wrong..."
+ if [[ '${{ needs.prep.outputs.APP_VERSION }}' != "$DOWNLOADED_VERSION" ]]; then
+ echo "Error: deployed version $DOWNLOADED_VERSION does not match local version ${{ needs.prep.outputs.APP_VERSION }}. Something went wrong..."
exit 1
fi
@@ -381,8 +386,8 @@ jobs:
run: |
sleep 5
DOWNLOADED_VERSION="$(wget -q -O /dev/stdout https://new.expensify.com/version.json | jq -r '.version')"
- if [[ '${{ env.VERSION }}' != "$DOWNLOADED_VERSION" ]]; then
- echo "Error: deployed version $DOWNLOADED_VERSION does not match local version ${{ env.VERSION }}. Something went wrong..."
+ if [[ '${{ needs.prep.outputs.APP_VERSION }}' != "$DOWNLOADED_VERSION" ]]; then
+ echo "Error: deployed version $DOWNLOADED_VERSION does not match local version ${{ needs.prep.outputs.APP_VERSION }}. Something went wrong..."
exit 1
fi
@@ -426,8 +431,8 @@ jobs:
# Build a version of iOS and Android HybridApp if we are deploying to staging
hybridApp:
runs-on: ubuntu-latest
- needs: validateActor
- if: ${{ fromJSON(needs.validateActor.outputs.IS_DEPLOYER) && github.ref == 'refs/heads/staging' }}
+ needs: prep
+ if: ${{ github.ref == 'refs/heads/staging' }}
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -467,23 +472,17 @@ jobs:
createPrerelease:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/staging' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }}
- needs: [checkDeploymentSuccess]
+ needs: [prep, checkDeploymentSuccess]
steps:
- - name: Checkout staging branch
- uses: actions/checkout@v4
-
- - name: Get current app version
- run: echo "STAGING_VERSION=$(jq -r .version < package.json)" >> "$GITHUB_ENV"
-
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
- name: 🚀 Create prerelease 🚀
run: |
- gh release create ${{ env.STAGING_VERSION }} --title ${{ env.STAGING_VERSION }} --generate-notes --prerelease --target staging
+ gh release create ${{ needs.prep.outputs.APP_VERSION }} --title ${{ needs.prep.outputs.APP_VERSION }} --generate-notes --prerelease --target staging
RETRIES=0
MAX_RETRIES=10
- until [[ $(gh release view ${{ env.STAGING_VERSION }}) || $RETRIES -ge $MAX_RETRIES ]]; do
+ until [[ $(gh release view ${{ needs.prep.outputs.APP_VERSION }}) || $RETRIES -ge $MAX_RETRIES ]]; do
echo "release not found, retrying $((MAX_RETRIES - RETRIES++)) times"
sleep 1
done
@@ -497,14 +496,14 @@ jobs:
- name: Upload artifacts to GitHub Release
run: |
- gh release upload ${{ env.STAGING_VERSION }} \
- ./android-sourcemaps-artifact/index.android.bundle.map#android-sourcemap-${{ env.STAGING_VERSION }} \
+ gh release upload ${{ needs.prep.outputs.APP_VERSION }} \
+ ./android-sourcemaps-artifact/index.android.bundle.map#android-sourcemap-${{ needs.prep.outputs.APP_VERSION }} \
./android-build-artifact/app-production-release.aab \
- ./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-sourcemap-${{ env.STAGING_VERSION }} \
+ ./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-sourcemap-${{ needs.prep.outputs.APP_VERSION }} \
./desktop-build-artifact/NewExpensify.dmg \
- ./ios-sourcemaps-artifact/main.jsbundle.map#ios-sourcemap-${{ env.STAGING_VERSION }} \
+ ./ios-sourcemaps-artifact/main.jsbundle.map#ios-sourcemap-${{ needs.prep.outputs.APP_VERSION }} \
./ios-build-artifact/New\ Expensify.ipa \
- ./web-sourcemaps-artifact/web-merged-source-map.js.map#web-sourcemap-${{ env.STAGING_VERSION }} \
+ ./web-sourcemaps-artifact/web-merged-source-map.js.map#web-sourcemap-${{ needs.prep.outputs.APP_VERSION }} \
./web-build-tar-gz-artifact/webBuild.tar.gz \
./web-build-zip-artifact/webBuild.zip
env:
@@ -531,14 +530,8 @@ jobs:
finalizeRelease:
runs-on: ubuntu-latest
if: ${{ github.ref == 'refs/heads/production' && fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }}
- needs: [checkDeploymentSuccess]
+ needs: [prep, checkDeploymentSuccess]
steps:
- - name: Checkout production branch
- uses: actions/checkout@v4
-
- - name: Get current app version
- run: echo "PRODUCTION_VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"
-
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4
@@ -549,10 +542,10 @@ jobs:
- name: Upload artifacts to GitHub Release
run: |
- gh release upload ${{ env.PRODUCTION_VERSION }} \
- ./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-sourcemap-${{ env.PRODUCTION_VERSION }} \
+ gh release upload ${{ needs.prep.outputs.APP_VERSION }} \
+ ./desktop-sourcemaps-artifact/desktop-merged-source-map.js.map#desktop-sourcemap-${{ needs.prep.outputs.APP_VERSION }} \
./desktop-build-artifact/NewExpensify.dmg \
- ./web-sourcemaps-artifact/web-merged-source-map.js.map#web-sourcemap-${{ env.PRODUCTION_VERSION }} \
+ ./web-sourcemaps-artifact/web-merged-source-map.js.map#web-sourcemap-${{ needs.prep.outputs.APP_VERSION }} \
./web-build-tar-gz-artifact/webBuild.tar.gz \
./web-build-zip-artifact/webBuild.zip
env:
@@ -561,8 +554,8 @@ jobs:
- name: 🚀 Edit the release to be no longer a prerelease 🚀
run: |
LATEST_RELEASE="$(gh release list --exclude-pre-releases --json tagName,isLatest --jq '.[] | select(.isLatest) | .tagName')"
- gh api --method POST /repos/Expensify/App/releases/generate-notes -f "tag_name=${{ env.PRODUCTION_VERSION }}" -f "previous_tag_name=$LATEST_RELEASE" | jq -r '.body' >> releaseNotes.md
- gh release edit ${{ env.PRODUCTION_VERSION }} --prerelease=false --latest --notes-file releaseNotes.md
+ gh api --method POST /repos/Expensify/App/releases/generate-notes -f "tag_name=${{ needs.prep.outputs.APP_VERSION }}" -f "previous_tag_name=$LATEST_RELEASE" | jq -r '.body' >> releaseNotes.md
+ gh release edit ${{ needs.prep.outputs.APP_VERSION }} --prerelease=false --latest --notes-file releaseNotes.md
env:
GITHUB_TOKEN: ${{ github.token }}
@@ -588,14 +581,8 @@ jobs:
name: Post a Slack message when all platforms deploy successfully
runs-on: ubuntu-latest
if: ${{ fromJSON(needs.checkDeploymentSuccess.outputs.IS_ALL_PLATFORMS_DEPLOYED) }}
- needs: [checkDeploymentSuccess, createPrerelease, finalizeRelease]
+ needs: [prep, checkDeploymentSuccess, createPrerelease, finalizeRelease]
steps:
- - name: Checkout
- uses: actions/checkout@v4
-
- - name: Set current App version in Env
- run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"
-
- name: 'Announces the deploy in the #announce Slack room'
uses: 8398a7/action-slack@v3
with:
@@ -605,7 +592,7 @@ jobs:
channel: '#announce',
attachments: [{
color: 'good',
- text: `🎉️ Successfully deployed ${process.env.AS_REPO} <https://github.com/Expensify/App/releases/tag/${{ env.VERSION }}|${{ env.VERSION }}> to ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'staging' }} 🎉️`,
+ text: `🎉️ Successfully deployed ${process.env.AS_REPO} <https://github.com/Expensify/App/releases/tag/${{ needs.prep.outputs.APP_VERSION }}|${{ needs.prep.outputs.APP_VERSION }}> to ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'staging' }} 🎉️`,
}]
}
env:
@@ -621,7 +608,7 @@ jobs:
channel: '#deployer',
attachments: [{
color: 'good',
- text: `🎉️ Successfully deployed ${process.env.AS_REPO} <https://github.com/Expensify/App/releases/tag/${{ env.VERSION }}|${{ env.VERSION }}> to ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'staging' }} 🎉️`,
+ text: `🎉️ Successfully deployed ${process.env.AS_REPO} <https://github.com/Expensify/App/releases/tag/${{ needs.prep.outputs.APP_VERSION }}|${{ needs.prep.outputs.APP_VERSION }}> to ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) && 'production' || 'staging' }} 🎉️`,
}]
}
env:
@@ -638,7 +625,7 @@ jobs:
channel: '#expensify-open-source',
attachments: [{
color: 'good',
- text: `🎉️ Successfully deployed ${process.env.AS_REPO} <https://github.com/Expensify/App/releases/tag/${{ env.VERSION }}|${{ env.VERSION }}> to production 🎉️`,
+ text: `🎉️ Successfully deployed ${process.env.AS_REPO} <https://github.com/Expensify/App/releases/tag/${{ needs.prep.outputs.APP_VERSION }}|${{ needs.prep.outputs.APP_VERSION }}> to production 🎉️`,
}]
}
env:
@@ -649,7 +636,7 @@ jobs:
name: Post a GitHub comments on all deployed PRs when platforms are done building and deploying
runs-on: ubuntu-latest
if: ${{ fromJSON(needs.checkDeploymentSuccess.outputs.IS_AT_LEAST_ONE_PLATFORM_DEPLOYED) }}
- needs: [android, desktop, iOS, web, checkDeploymentSuccess, createPrerelease, finalizeRelease]
+ needs: [prep, android, desktop, iOS, web, checkDeploymentSuccess, createPrerelease, finalizeRelease]
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -657,14 +644,11 @@ jobs:
- name: Setup Node
uses: ./.github/actions/composite/setupNode
- - name: Set current App version in Env
- run: echo "VERSION=$(npm run print-version --silent)" >> "$GITHUB_ENV"
-
- name: Get Release Pull Request List
id: getReleasePRList
uses: ./.github/actions/javascript/getDeployPullRequestList
with:
- TAG: ${{ env.VERSION }}
+ TAG: ${{ needs.prep.outputs.APP_VERSION }}
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
IS_PRODUCTION_DEPLOY: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
@@ -673,7 +657,7 @@ jobs:
with:
PR_LIST: ${{ steps.getReleasePRList.outputs.PR_LIST }}
IS_PRODUCTION_DEPLOY: ${{ fromJSON(env.SHOULD_DEPLOY_PRODUCTION) }}
- DEPLOY_VERSION: ${{ env.VERSION }}
+ DEPLOY_VERSION: ${{ needs.prep.outputs.APP_VERSION }}
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }}
ANDROID: ${{ needs.android.result }}
DESKTOP: ${{ needs.desktop.result }}
Updated |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeiOS: NativeiOS: mWeb SafariMacOS: Chrome / SafariMacOS: Desktop |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
[No QA] Fix finalizeRelease job (cherry picked from commit b4d1cab) (CP triggered by roryabraham)
Details
Fixed Issues
$ Fix broken run: https://github.com/Expensify/App/actions/runs/10776607506/job/29884679772
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop