Skip to content

Instantly share code, notes, and snippets.

@zhangtaii
Last active February 24, 2021 22:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zhangtaii/93088c1431e2b95efa2b839972166763 to your computer and use it in GitHub Desktop.
Save zhangtaii/93088c1431e2b95efa2b839972166763 to your computer and use it in GitHub Desktop.
Setup Azure Pipelines for React Native
trigger:
branches:
include:
- master
- releases/*
exclude:
- refs/tag/*
pool:
vmImage: 'macOS-10.13'
steps:
- checkout: self
persistCredentials: true
- task: ShellScript@2
inputs:
scriptPath: appcenter-post-clone.sh
displayName: Post Clone Script
- task: NodeTool@0
inputs:
versionSpec: '8.x'
displayName: Select Node version
- script: yarn install
displayName: yarn install
- task: ShellScript@2
inputs:
scriptPath: appcenter-pre-build.sh
displayName: Pre Build Script
continueOnError: false
- task: Gradle@2
inputs:
workingDirectory: 'android'
gradleWrapperFile: 'android/gradlew'
tasks: 'assembleRelease'
continueOnError: false
- script: mv android/app/build/outputs/apk/release/app-release-unsigned.apk app-release.apk
displayName: Android Postprocess
continueOnError: false
- task: AndroidSigning@3
inputs:
apkFiles: 'app-release.apk'
apksign: true # Optional
apksignerKeystoreFile: 'my-release-key.keystore' # Required when apksign == True
apksignerKeystorePassword: $(KeystorePassword) # Optional
apksignerKeystoreAlias: $(KeystoreAlias) # Optional
apksignerKeyPassword: $(KeyPassword) # Optional
#apksignerArguments: '--verbose' # Optional
#apksignerFile: # Optional
#zipalign: true # Optional
#zipalignFile: # Optional
- task: CopyFiles@2
inputs:
contents: 'app-release.apk'
targetFolder: $(Build.ArtifactStagingDirectory)
- task: ShellScript@2
inputs:
scriptPath: appcenter-post-build.sh
displayName: Post Build Script
- task: PublishBuildArtifacts@1
- task: AppCenterDistribute@1
inputs:
serverEndpoint: 'appcenter'
appSlug: 'place your appSlug herer'
appFile: 'app-release.apk'
releaseNotesOption: 'input' # Options: input, file
releaseNotesInput: $(Build.SourceVersionMessage) # Required when releaseNotesOption == Input
distributionGroupId: 'place your distributionGroupId here'
@sahalshn
Copy link

sahalshn commented Jan 1, 2020

##[error]Not found scriptPath: /Users/runner/runners/2.163.1/work/1/s/appcenter-post-clone.sh
##[error]Bash failed with error: Not found scriptPath: /Users/runner/runners/2.163.1/work/1/s/appcenter-post-clone.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment