Skip to content

docs: add PUBLISHING.md #12

docs: add PUBLISHING.md

docs: add PUBLISHING.md #12

Workflow file for this run

name: Publish
on:
push:
branches: [main]
paths:
- CHANGELOG.md
- pubspec.yaml
jobs:
check-release:
runs-on: ubuntu-latest
outputs:
should_publish: ${{ steps.check_release.outputs.should_publish }}
steps:
- name: 📚 Git Checkout
uses: actions/checkout@v4
- name: 🔍 Check if There is a Release Commit
id: check_release
run: |
# Get the latest commit message
latest_commit_msg=$(git log -1 --pretty=%B)
# Check if the commit message matches the release pattern
if [[ "$latest_commit_msg" =~ ^chore\(release\):\ v.* ]]; then
echo "should_publish=true" >> $GITHUB_OUTPUT
else
echo "should_publish=false" >> $GITHUB_OUTPUT
fi
publish:
needs: check-release
if: needs.check-release.outputs.should_publish == 'true'
uses: halildurmus/workflows/.github/workflows/dart_pub_publish.yml@main
secrets:
token: ${{ secrets.PAT }}