How to publish build status updates to Slack with links to artifacts in codemagic.yaml
Integrate Slack publishing into your Codemagic build pipeline to get notified when a build starts and receive build artifacts or logs when the build finishes.
Connecting your Slack workspace
To set up publishing to Slack, you first need to connect your Slack workspace in Teams > Personal Account > Integrations > Slack for personal apps and in Teams > Your Team Name > Team integrations > Slack for team apps.
After you have successfully authorized Codemagic and connected your workspace, you will be redirected back to Codemagic. You can disconnect your Slack workspace anytime by clicking Disconnect.
Configuring Slack publishing
The Slack channel for publishing is configured separately for each workflow in the
publishing section of
codemagic.yaml (refer here if you’re configuring app settings in the Flutter workflow editor).
@codemagicin the channel. If the private channel access is restricted by Slack admin rights, it will have to be changed manually, otherwise publishing to that channel will not be possible.
If the build finishes successfully, release notes (if passed) and the generated artifacts will be published to the specified channel. The artifact download links in Slack notifications are, by default, valid for 24 hours; the lifetime of publicly accessible artifact download links is configurable in Team settings > Artifact download links.
If the build fails, a link to the build logs is published. When you set
true, the channel will be notified when a build starts.
If you don’t want to receive a Slack notification on build success or failure, you can set
publishing: slack: channel: '#channel-name' notify_on_build_start: true # To receive a notification when a build starts notify: success: false # To not receive a notification when a build succeeds failure: false # To not receive a notification when a build fails
When you set up Slack publishing, Codemagic publishes the following artifacts:
- the archive with Flutter web build directory
- Linux application bundle files, Windows MSIX packages