This configuration is for create releases and release assets to Github releases. Release assets will include the ProGard mapping files generated when building the project.
You first need to add the following environment variables to your project:
// the token you have generated that can be used to access the GitHub API
// https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token.
GITHUB_RELEASES_TOKEN="Access token"
GITHUB_RELEASES_API_URL="https://api.github.com/repos"
GITHUB_RELEASES_REPO_OWNER="Repository owner"
GITHUB_RELEASES_REPO="Repository name"
Apply the plugin in your top-level build.gradle
file.
apply from: 'config/publish/releases/github-api.gradle'
./gradlew build githubRelease
This will do the following:
- Create a new Github release with the current version name. If a tag with the same name already exists, the task will fail with
Status: 422 Unprocessable Entity
server error. - Upload the modules mappings zip file to Github Releases assets. If a file with the same name already exists, the task will fail with
Status: 422 Unprocessable Entity
server error.