Skip to content

Publish Android Libraries to GitHub Packages #3

Publish Android Libraries to GitHub Packages

Publish Android Libraries to GitHub Packages #3

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
name: Publish Android Libraries to GitHub Packages
on:
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@3
with:
distribution: 'adopt'
java-version-file: ./.java-version
cache: 'gradle'
- name: Allow running ./gradlew
run: chmod +x ./gradlew
working-directory: ./android
- name: Publish to GitHub Packages
env:
USERNAME: ${{ github.actor }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew publishReleasePublicationToGitHubPackagesRepository
working-directory: ./android