Skip to content

Merge pull request #2253 from leancodepl/use-java-from-flutter-doctor #149

Merge pull request #2253 from leancodepl/use-java-from-flutter-doctor

Merge pull request #2253 from leancodepl/use-java-from-flutter-doctor #149

name: patrol_cli publish
on:
push:
tags: ['patrol_cli-v*']
jobs:
publish:
name: Publish on pub.dev
runs-on: ubuntu-latest
outputs:
package_name: ${{ steps.pub_release.outputs.package_name }}
package_version: ${{ steps.pub_release.outputs.package_version }}
changelog_url: ${{ steps.pub_release.outputs.changelog_url }}
prerelease: ${{ steps.pub_release.outputs.prerelease }}
permissions:
id-token: write
contents: write
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Check if versions are defined consistently
working-directory: packages/patrol_cli
run: ./check_versions
# This step adds the auth token for pub.dev
- name: Set up Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: Publish to pub.dev
id: pub_release
uses: leancodepl/mobile-tools/.github/actions/pub-release@pub-release-v1
with:
path: packages/patrol_cli
notify:
name: Notify on Slack
runs-on: ubuntu-latest
needs: publish
if: needs.publish.outputs.prerelease == 'false'
steps:
- name: Share test results on Slack
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_CHANNEL: ${{ vars.SLACK_RELEASES_CHANNEL }}
SLACK_USERNAME: Patrol CI on GitHub Actions
SLACK_ICON: ${{ vars.SLACK_ICON }}
SLACK_TITLE: New ${{ needs.publish.outputs.package_name }} version
SLACK_MESSAGE: |
${{ needs.publish.outputs.package_name }} ${{ needs.publish.outputs.package_version }} has been released 🎉
See release notes <${{ needs.publish.outputs.changelog_url }}|here>