skip to Main Content

Want to upload flutter release app to the app center with Gitlab CI/CD.
I want to know is how to add or write script for app release note within .gitlab-ci.yml. Here is my example deploy script and how to make it.

deploy_android_to_appcenter:
  stage: deploy
  only:
    - XXXX/XXXX
  script:
    - appcenter login --token $APPCENTER_API_TOKEN
    - appcenter distribute release -f build/app/outputs/apk/release/app-release.apk -g Collaborators —app [Name]/[App-Name]
  tags:
    - branchName
    

2

Answers


  1. Chosen as BEST ANSWER

    I found the answer from git hub issue. By adding --release-notes "$(cat release_notes.*)" inside appcenter distribute release shell command. And need to create release_notes.md inside the root of project. But always update manually that file for every build.

    Example:

    deploy_android_to_appcenter:
      stage: deploy
      only:
        - dev_branch
      script:
        - appcenter login --token $APPCENTER_API_TOKEN
        - appcenter distribute release --app [name]/[app] --file build/app/outputs/apk/release/app-release.apk --group Collaborators --release-notes "$(cat release_notes.*)"
      tags:
        - dev
    

  2. To add a script for app release notes within your GitLab CI/CD configuration file (.gitlab-ci.yml), you can use a combination of GitLab CI variables and scripting.

    stages:
      - build
      - release
    
    variables:
      APP_VERSION: "1.0.0"
      RELEASE_NOTES: "Initial release"
    
    build:
      stage: build
      script:
        - flutter build apk --release
    
    release:
      stage: release
      script:
        - echo $RELEASE_NOTES > release_notes.txt
        - git tag -a v$APP_VERSION -F release_notes.txt
        - git push --tags
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search