Merge pull request #178 from muj-i/main #20
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: Publish to Pub.dev 🚀 | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
publishing: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout 🛎️ | |
uses: actions/checkout@v3 | |
- name: Check Versions 🔎 | |
run: | | |
set -eo pipefail | |
export LIB_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`) | |
export VRSN=$(grep 'String version = ' lib/models/agora_rtm_mute_request.dart | sed -e 's,.*\"\(.*\)\";,\1,') | |
export PUBSPEC_VERSION=$(grep 'version: ' pubspec.yaml | sed -e 's,.*: \(.*\),\1,') | |
if [ "$LIB_VERSION" != "$VRSN" ]; then | |
echo "Version in 'lib/models/agora_rtm_mute_request.dart' does not match tag."; | |
exit 1; | |
fi | |
if [ "$LIB_VERSION" != "$PUBSPEC_VERSION" ]; then | |
echo "Version in 'pubspec.yaml' does not match tag."; | |
exit 1; | |
fi | |
- name: Publish Dart Package 🚢 | |
uses: k-paxian/[email protected] | |
with: | |
accessToken: ${{ secrets.OAUTH_ACCESS_TOKEN }} | |
refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }} |