Merge pull request #2166 from leancodepl/prepare-release #120
Workflow file for this run
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
name: patrol publish | |
on: | |
push: | |
tags: ['patrol-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 | |
strategy: | |
matrix: | |
flutter-version: ['3.16.x'] | |
flutter-channel: ['stable'] | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v4 | |
# This step adds the auth token for pub.dev | |
- name: Set up Dart | |
uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: stable | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ matrix.flutter-version }} | |
channel: ${{ matrix.flutter-channel }} | |
- name: Build DevTools extension | |
working-directory: packages/patrol_devtools_extension | |
run: ./publish_to_patrol_extension | |
- name: Verify that built DevTools extension is in the correct location | |
working-directory: packages/patrol | |
run: test ! -z "$(ls -lA extension/devtools/build)" | |
- name: Publish to pub.dev | |
id: pub_release | |
uses: leancodepl/mobile-tools/.github/actions/pub-release@pub-release-v1 | |
with: | |
path: packages/patrol | |
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> |