1

I want to set the version number from the GitHub action script for Firebase App distribution. Here is the place:

enter image description here

I have already tried using the below Github action script, but it seems there are no appRelease options for firebase appdistribution:distribute plugin

    # Extract Version from Git Tag
  - name: Extract Version from Tag
    id: extract_version
    run: echo "::set-output name=version::$(echo ${{ github.ref }} | sed -n 's/refs\/tags\/v//p')"

  # Extract Release Notes from Tag Message
  - name: Extract Release Notes from Tag
    id: get_tag_message
    run: |
      tag_message=$(git log -1 --pretty=%B)
      echo "::set-output name=tag-message::$tag_message"

  # Upload APK to Firebase App Distribution
  - name: Upload APK to Firebase App Distribution
    run: |
      firebase appdistribution:distribute build/app/outputs/flutter-apk/app-release.apk \
      --app "${{ secrets.APPID }}" \
      --groups "testers" \
      --debug \
      --release-notes "Version: ${{ steps.extract_version.outputs.version }} | Release Notes: ${{ steps.get_tag_message.outputs.tag-message }}" 

Can anybody help to set the version number here?

1 Answer 1

2

I think Firebase gets the version from the android:versionName field in AndroidManifest.xml file (which is contained in the .apk). Have you checked the value of that field? As for the number in the parentheses, that is the android:versionCode field used to determine whether the build is an upgrade or downgrade, as explained here.

2
  • I am working with Flatter App and there is a version 'version: 1.0.0+1' in pubspec.yaml. Not sure if it is the source or not.
    – mnhmilu
    Commented Oct 19, 2024 at 5:00
  • From what I've looked up, seems like that version is being copied into AndroidManifest.xml - in this example, 1.0.0 would basically be copied into versionName field, while 1 would be copied into versionCode field. In order to have different apps in Firebase App Distribution, you should find a way to increment that number (preferably as a build step, probably) every time you build your app (so it would go 1.0.0+2, 1.0.0+3 etc.). Seems like this is a default behavior - you can avoid this process of automatically copying version but this seems way more convenient.
    – Ilija
    Commented Oct 26, 2024 at 21:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.