Skip to content

Commit

Permalink
Gate client release version and add slack notifs (#6626)
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondjacobson authored Nov 10, 2023
1 parent 090ad1c commit effeb6b
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 5 deletions.
50 changes: 50 additions & 0 deletions .circleci/src/commands/@mobile-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,23 @@ mobile-release-ios:
- run:
name: fastlane build and upload
command: cd packages/mobile/ios && bundle exec fastlane build_and_upload bundle_id:<<parameters.bundle-id>>
- run:
name: slack announce
command: |
cd packages/mobile
deploying_version=$(jq -r '.version' package.json)
job_url="https://app.circleci.com/pipelines/workflows/$CIRCLE_WORKFLOW_ID"
environment=<<parameters.bundle-id>>
json_content="{ \"blocks\": ["
json_content+="{ \"type\": \"section\", \"text\": { \"type\": \"mrkdwn\", \"text\": \"Deployed $environment v$<${job_url}|$deploying_version> to mobile ios \n\" } }"
json_content+="]}"
echo "Text to send to slack: $json_content"
# Send Slack message
curl -f -X POST -H 'Content-type: application/json' \
--data "$json_content" \
$SLACK_DAILY_DEPLOY_WEBHOOK
# Prepare to build/upload/release Android
mobile-prepare-android:
Expand Down Expand Up @@ -199,6 +216,23 @@ mobile-release-android:
command: |
cd packages/mobile/android
bundle exec fastlane <<parameters.upload-type>> track:<<parameters.track>>
- run:
name: slack announce
command: |
cd packages/mobile
deploying_version=$(jq -r '.version' package.json)
environment=<<parameters.upload-type>>
job_url="https://app.circleci.com/pipelines/workflows/$CIRCLE_WORKFLOW_ID"
json_content="{ \"blocks\": ["
json_content+="{ \"type\": \"section\", \"text\": { \"type\": \"mrkdwn\", \"text\": \"Deployed $environment v$<${job_url}|$deploying_version> to mobile android \n\" } }"
json_content+="]}"
echo "Text to send to slack: $json_content"
# Send Slack message
curl -f -X POST -H 'Content-type: application/json' \
--data "$json_content" \
$SLACK_DAILY_DEPLOY_WEBHOOK
# Deploy Solana saga dApp store
mobile-release-saga-dapp-store:
Expand Down Expand Up @@ -272,3 +306,19 @@ mobile-release-saga-dapp-store:
git add packages/mobile/dapp-store/.asset-manifest.json packages/mobile/dapp-store/config.yaml
git commit -m 'Update dapp-store build artifacts'
git push origin main
- run:
name: slack announce
command: |
cd packages/mobile
deploying_version=$(jq -r '.version' package.json)
job_url="https://app.circleci.com/pipelines/workflows/$CIRCLE_WORKFLOW_ID"
json_content="{ \"blocks\": ["
json_content+="{ \"type\": \"section\", \"text\": { \"type\": \"mrkdwn\", \"text\": \"Deployed v$<${job_url}|$deploying_version> to mobile saga \n\" } }"
json_content+="]}"
echo "Text to send to slack: $json_content"
# Send Slack message
curl -f -X POST -H 'Content-type: application/json' \
--data "$json_content" \
$SLACK_DAILY_DEPLOY_WEBHOOK
41 changes: 41 additions & 0 deletions .circleci/src/commands/@web-commands.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ web-distribute:
install-license:
default: false
type: boolean
environment:
default: 'prod'
type: string
os:
default: 'mac'
type: string
steps:
- checkout
- attach_workspace:
Expand Down Expand Up @@ -120,6 +126,24 @@ web-distribute:
command: |
cd packages/web
npm run dist:<< parameters.build-type >>
- run:
name: slack announce
command: |
cd packages/web
deploying_version=$(jq -r '.version' package.json)
environment="<< parameters.environment >>"
os="<< parameters.os >>"
job_url="https://app.circleci.com/pipelines/gh/AudiusProject/audius-protocol/$pipeline_number/workflows/$workflow_id"
json_content="{ \"blocks\": ["
json_content+="{ \"type\": \"section\", \"text\": { \"type\": \"mrkdwn\", \"text\": \"Deployed $environment v$<${job_url}|$deploying_version> to desktop $os \n\" } }"
json_content+="]}"
echo "Text to send to slack: $json_content"
# Send Slack message
curl -f -X POST -H 'Content-type: application/json' \
--data "$json_content" \
$SLACK_DAILY_DEPLOY_WEBHOOK
web-install-wrangler:
steps:
Expand Down Expand Up @@ -167,6 +191,23 @@ web-deploy-cloudflare:
cd packages/web
echo ${GA_ACCESS_TOKEN} | npx wrangler secret put GA_ACCESS_TOKEN --env << parameters.environment >>
npx wrangler publish --env << parameters.environment >>
- run:
name: slack announce
command: |
cd packages/web
deploying_version=$(jq -r '.version' package.json)
environment="<< parameters.environment >>"
job_url="https://app.circleci.com/pipelines/gh/AudiusProject/audius-protocol/$pipeline_number/workflows/$workflow_id"
json_content="{ \"blocks\": ["
json_content+="{ \"type\": \"section\", \"text\": { \"type\": \"mrkdwn\", \"text\": \"Deployed $environment v$<${job_url}|$deploying_version> to web \n\" } }"
json_content+="]}"
echo "Text to send to slack: $json_content"
# Send Slack message
curl -f -X POST -H 'Content-type: application/json' \
--data "$json_content" \
$SLACK_DAILY_DEPLOY_WEBHOOK
web-deploy-sourcemaps-s3:
steps:
Expand Down
12 changes: 12 additions & 0 deletions .circleci/src/jobs/@web-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ web-dist-mac-staging:
- web-distribute:
build-type: mac-publish
install-license: true
environment: 'staging'
os: 'mac'

web-dist-win-staging:
working_directory: ~/audius-protocol
Expand All @@ -262,6 +264,8 @@ web-dist-win-staging:
steps:
- web-distribute:
build-type: win-publish
environment: 'staging'
os: 'win'

web-dist-linux-staging:
working_directory: ~/audius-protocol
Expand All @@ -270,6 +274,8 @@ web-dist-linux-staging:
steps:
- web-distribute:
build-type: linux-publish
environment: 'staging'
os: 'linux'

web-dist-mac-production:
working_directory: ~/audius-protocol
Expand All @@ -284,6 +290,8 @@ web-dist-mac-production:
- web-distribute:
build-type: mac-publish-production
install-license: true
environment: 'production'
os: 'mac'

web-dist-win-production:
working_directory: ~/audius-protocol
Expand All @@ -292,6 +300,8 @@ web-dist-win-production:
steps:
- web-distribute:
build-type: win-publish-production
environment: 'production'
os: 'win'

web-dist-linux-production:
working_directory: ~/audius-protocol
Expand All @@ -300,3 +310,5 @@ web-dist-linux-production:
steps:
- web-distribute:
build-type: linux-publish-production
environment: 'production'
os: 'linux'
12 changes: 9 additions & 3 deletions .circleci/src/workflows/mobile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ jobs:
only: /(^release.*)$/

- mobile-deploy-codepush-production-ios-if-ota-release:
context: Audius Mobile Client
context:
- Audius Mobile Client
- slack-secrets
requires:
- mobile-hold-deploy-codepush-ios-if-ota-release
filters:
Expand Down Expand Up @@ -130,7 +132,9 @@ jobs:
only: /(^release.*)$/

- mobile-deploy-codepush-production-android-if-ota-release:
context: Audius Mobile Client
context:
- Audius Mobile Client
- slack-secrets
requires:
- mobile-hold-deploy-codepush-android-if-ota-release
filters:
Expand All @@ -146,7 +150,9 @@ jobs:
only: /(^release.*)$/

- mobile-deploy-saga-dapp-store:
context: Audius Mobile Client
context:
- Audius Mobile Client
- slack-secrets
requires:
- mobile-hold-deploy-saga-dapp-store
filters:
Expand Down
14 changes: 12 additions & 2 deletions .circleci/src/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ jobs:
only: /^main$/

- web-deploy-staging-cloudflare:
context: Audius Client
context:
- Audius Client
- slack-secrets
requires:
- web-build-staging
filters:
Expand Down Expand Up @@ -91,7 +93,9 @@ jobs:
branches:
only: /(^release.*)$/
- web-deploy-production-cloudflare:
context: Audius Client
context:
- Audius Client
- slack-secrets
requires:
- web-hold-production
filters:
Expand All @@ -112,6 +116,7 @@ jobs:
context:
- Audius Client
- Vercel
- slack-secrets
requires:
- web-build-staging
filters:
Expand All @@ -121,6 +126,7 @@ jobs:
context:
- Audius Client
- Vercel
- slack-secrets
requires:
- web-build-staging
filters:
Expand All @@ -130,6 +136,7 @@ jobs:
context:
- Audius Client
- Vercel
- slack-secrets
requires:
- web-build-staging
filters:
Expand All @@ -148,6 +155,7 @@ jobs:
context:
- Audius Client
- Vercel
- slack-secrets
requires:
- web-hold-dist-mac-production
filters:
Expand All @@ -164,6 +172,7 @@ jobs:
context:
- Audius Client
- Vercel
- slack-secrets
requires:
- web-hold-dist-win-production
filters:
Expand All @@ -180,6 +189,7 @@ jobs:
context:
- Audius Client
- Vercel
- slack-secrets
requires:
- web-hold-dist-linux-production
filters:
Expand Down

0 comments on commit effeb6b

Please sign in to comment.