chore: update version to 1.0.7-beta.4 in pubspec.yaml #9
This file contains hidden or 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: Auto Tag Release | |
| permissions: | |
| contents: write | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "pubspec.yaml" # Trigger when pubspec is updated (likely version changes) | |
| jobs: | |
| create-tag: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Dart | |
| uses: dart-lang/setup-dart@v1 | |
| - name: Extract version from pubspec | |
| id: version | |
| run: | | |
| VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //' | tr -d ' ' | tr -d '\r') | |
| echo "VERSION=v$VERSION" >> $GITHUB_ENV | |
| echo "Version extracted: v$VERSION" | |
| - name: Check if tag exists | |
| id: check_tag | |
| run: | | |
| if git tag -l "${{ env.VERSION }}" | grep -q "${{ env.VERSION }}"; then | |
| echo "TAG_EXISTS=true" >> $GITHUB_ENV | |
| echo "Tag ${{ env.VERSION }} already exists" | |
| else | |
| echo "TAG_EXISTS=false" >> $GITHUB_ENV | |
| echo "Tag ${{ env.VERSION }} does not exist" | |
| fi | |
| - name: Create and push tag | |
| if: env.TAG_EXISTS == 'false' | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "actions@github.com" | |
| git tag -a ${{ env.VERSION }} -m "Release ${{ env.VERSION }}" | |
| git push https://x-access-token:${{ secrets.GH_PAT }}@github.com/${{ github.repository }} ${{ env.VERSION }} | |
| echo "Created and pushed tag: ${{ env.VERSION }}" |