Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: ⚠️ GitHub Releases requires a tag #592

Closed
HumanBot000 opened this issue Feb 25, 2025 · 1 comment
Closed

Error: ⚠️ GitHub Releases requires a tag #592

HumanBot000 opened this issue Feb 25, 2025 · 1 comment

Comments

@HumanBot000
Copy link

But I am creating a tag inside the workflow

name: Flutter Release Workflow

on:
  push:
    branches:
      - master
    paths:
      - 'pubspec.yaml'
      - '**/*.dart'
permissions:
  contents: write
jobs:
  flutter:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v2

      - name: Check if version is increased
        id: version-check
        run: |
...
          # Check if the version has increased (including build number changes)
          if [ "$NEW_VERSION" == "$PREVIOUS_VERSION" ]; then
            echo "No new version detected."
            exit 0
          else
            echo "New version detected: $NEW_VERSION"
          fi

      - name: Set up Flutter
...

      - name: Cache Flutter dependencies
...

      - name: Set up JDK 17
...

      - name: Set JAVA_HOME environment variable
        run: echo "JAVA_HOME=${{ env.JAVA_HOME }}" >> $GITHUB_ENV

      - name: Update Gradle Java Home
...

      - name: Install dependencies
        run: flutter pub get

      - name: Run Dart fix and format
        run: |
          flutter pub get
          dart fix --apply
          dart format .

      - name: Generate changelog
        id: changelog
        run: |
...
      - name: Tag version and push
        run: |
          git config --global user.email "github-actions[bot]@users.noreply.github.com"
          git config --global user.name "github-actions[bot]"
          git tag "v${NEW_VERSION}"
          git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git "v${NEW_VERSION}"
      - name: Fetch tags again to ensure latest tag is available
        run: git fetch --tags
      - name: Build release APK
        run: flutter build apk --release --dart-define=GEONAMES_API_USER=humanbot000
      - name: Create GitHub release
        uses: softprops/action-gh-release@v1
        with:
          files: build/app/outputs/flutter-apk/app-release.apk
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

But the tag is created and also pushed. I see it inside my repository before the Create GitHub release step is started
Image

@HumanBot000
Copy link
Author

Switched to v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant