forked from Expensify/App
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Expensify#1858 from Expensify/Rory-productionDeplo…
…yCash Create finishReleaseCycle workflow
- Loading branch information
Showing
2 changed files
with
106 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
name: Prepare production deploy | ||
|
||
on: | ||
issues: | ||
types: [closed] | ||
|
||
jobs: | ||
# This job is executed when a StagingDeployCash is closed. | ||
# It updates the production branch to trigger the production deploy, | ||
# and creates a new StagingDeployCash for the next release cycle. | ||
updateProduction: | ||
runs-on: ubuntu-latest | ||
|
||
# Note: Anyone with Triage access to the Expensify.cash repo can trigger a production deploy | ||
if: contains(github.event.issue.labels.*.name, 'StagingDeployCash') | ||
steps: | ||
- uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f | ||
with: | ||
ref: staging | ||
fetch-depth: 0 | ||
token: ${{ secrets.OS_BOTIFY_TOKEN }} | ||
|
||
- name: Set up git config | ||
run: git config user.name OSBotify | ||
|
||
- name: Set new version for production branch | ||
run: echo "PRODUCTION_VERSION=$(npm run print-version --silent)" >> $GITHUB_ENV | ||
|
||
- name: Create Pull Request (production) | ||
# Version: 2.4.3 | ||
uses: repo-sync/pull-request@33777245b1aace1a58c87a29c90321aa7a74bd7d | ||
with: | ||
source_branch: staging | ||
destination_branch: production | ||
pr_label: automerge | ||
github_token: ${{ secrets.OS_BOTIFY_TOKEN }} | ||
pr_title: Update version to ${{ env.PRODUCTION_VERSION }} on staging | ||
pr_body: Update version to ${{ env.PRODUCTION_VERSION }} | ||
|
||
- name: Create a new branch off master | ||
run: | | ||
git checkout master | ||
git checkout -b version-bump-${{ github.sha }} | ||
git push --set-upstream origin version-bump-${{ github.sha }} | ||
- name: Generate a new version | ||
id: bumpVersion | ||
uses: Expensify/Expensify.cash/.github/actions/bumpVersion@master | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} | ||
|
||
- name: Commit new version | ||
run: | | ||
git add \ | ||
./package.json \ | ||
./package-lock.json \ | ||
./android/app/build.gradle \ | ||
./ios/ExpensifyCash/Info.plist \ | ||
./ios/ExpensifyCashTests/Info.plist | ||
git commit -m "Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }}" | ||
- name: Create Pull Request (master) | ||
uses: peter-evans/create-pull-request@09b9ac155b0d5ad7d8d157ed32158c1b73689109 | ||
with: | ||
token: ${{ secrets.OS_BOTIFY_TOKEN }} | ||
author: OSBotify <[email protected]> | ||
base: master | ||
branch: version-bump-${{ github.sha }} | ||
title: Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }} on master | ||
body: Update version to ${{ steps.bumpVersion.outputs.NEW_VERSION }} | ||
labels: automerge | ||
|
||
#TODO: Once we add cherry picking, we will need run this from elsewhere | ||
- name: Tag version | ||
run: git tag ${{ steps.bumpVersion.outputs.NEW_VERSION }} | ||
|
||
- name: 🚀 Push tags to trigger staging deploy 🚀 | ||
run: git push --tags | ||
|
||
- name: Create new StagingDeployCash | ||
uses: Expensify/Expensify.cash/.github/actions/createOrUpdateStagingDeploy@master | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} | ||
NPM_VERSION: ${{ steps.bumpVersion.outputs.NEW_VERSION }} | ||
|
||
# This Slack step is duplicated in all workflows, if you make a change to this step, make sure to update all | ||
# the other workflows with the same change | ||
- uses: 8398a7/action-slack@v3 | ||
name: Job failed Slack notification | ||
if: ${{ failure() }} | ||
with: | ||
status: custom | ||
fields: workflow, repo | ||
custom_payload: | | ||
{ | ||
channel: '#announce', | ||
attachments: [{ | ||
color: "#DB4545", | ||
pretext: `<!here>`, | ||
text: `💥 ${process.env.AS_REPO} failed on ${process.env.AS_WORKFLOW} workflow 💥`, | ||
}] | ||
} | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters