{"id":16757205,"url":"https://github.com/patilshreyas/androidgpr","last_synced_at":"2025-04-10T16:53:04.347Z","repository":{"id":43663685,"uuid":"300517652","full_name":"PatilShreyas/AndroidGPR","owner":"PatilShreyas","description":"Demonstration of deploying Android library to the GitHub Package Registry using GitHub Actions CI/CD","archived":false,"fork":false,"pushed_at":"2020-10-02T07:28:31.000Z","size":150,"stargazers_count":26,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-24T14:45:28.046Z","etag":null,"topics":["android","android-library","devops","github-actions","github-package-registry","hacktoberfest","maven"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PatilShreyas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-02T06:07:37.000Z","updated_at":"2024-04-02T17:47:46.000Z","dependencies_parsed_at":"2022-08-29T04:40:29.630Z","dependency_job_id":null,"html_url":"https://github.com/PatilShreyas/AndroidGPR","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatilShreyas%2FAndroidGPR","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatilShreyas%2FAndroidGPR/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatilShreyas%2FAndroidGPR/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PatilShreyas%2FAndroidGPR/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PatilShreyas","download_url":"https://codeload.github.com/PatilShreyas/AndroidGPR/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248256601,"owners_count":21073557,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","android-library","devops","github-actions","github-package-registry","hacktoberfest","maven"],"created_at":"2024-10-13T03:43:10.322Z","updated_at":"2025-04-10T16:53:04.316Z","avatar_url":"https://github.com/PatilShreyas.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Android Library - Release with _Github Package Registry_ \n\n- Demonstration of deploying Android library to the GitHub Package Registry using GitHub Actions CI/CD.\n- In this example, whenever git tag is pushed to the GitHub branch then automatically library is published to the GitHub package registry and GitHub release is created (in draft mode).\n\n## Workflow\n\nRefer [`release.yml`](/.github/workflows/release.yml) workflow which is GitHub Actions workflow for publishing package and creating draft release.\n \n## Library configuration\n\nRefer [`build.gradle`](simplelibrary/build.gradle) of [**simplelibrary**](simplelibrary/) module.\n\n```gradle\napply plugin: 'maven-publish'  // 1. Apply plugin\n\n// 2. Declare library details\next {\n    mGroupId = \"com.example\"\n    mArtifactId = \"simple-library\"\n    mVersionCode = 1\n    mVersionName = \"0.2.0\"\n\n    mLibraryName = \"SimpleLibrary\"\n    mLibraryDescription = \"Simple Library for simple things!\"\n}\n\nandroid {}\n\ndependencies {}\n\n\n// 3. Declare task for creation of android sources.\ntask androidSourcesJar(type: Jar) {\n    archiveClassifier.set('sources')\n    from android.sourceSets.main.java.srcDirs\n}\n\n// 4. Make configuration for publishing artifact.\nafterEvaluate {\n    publishing {\n        publications {\n            maven(MavenPublication) {\n                groupId mGroupId\n                artifactId mArtifactId\n                version mVersionName\n\n                from components.release\n\n                artifact androidSourcesJar\n\n                pom {\n                    name = mLibraryName\n                    description = mLibraryDescription\n                }\n            }\n        }\n\n        // 5. Update repository details and credentials.\n        repositories {\n            maven {\n                name = \"GitHubPackages\"\n                url = uri(\"https://maven.pkg.github.com/PatilShreyas/AndroidGPR\")\n                credentials {\n                    username = System.getenv(\"GPR_USER\")\n                    password = System.getenv(\"GPR_KEY\")\n                }\n            }\n        }\n    }\n}\n\n// Assembling should be performed before publishing package\npublish.dependsOn assemble\n```\n\n## Implement library in app\n\nRefer [`build.gradle`](app/build.gradle) of [**app**](app/) module.\n\n```gradle\ndef localProperties = new Properties()\nlocalProperties.load(new FileInputStream(rootProject.file(\"local.properties\")))\n\nrepositories {\n    maven {\n        name = \"GitHubPackages\"\n        url = uri(\"https://maven.pkg.github.com/PatilShreyas/AndroidGPR\")\n        credentials {\n            username = 'PatilShreyas'\n            password = localProperties.getProperty(\"GPR_TOKEN\")\n        }\n    }\n}\n\ndependencies {\n    // Simple library\n    implementation 'com.example:simple-library:0.2.0'\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatilshreyas%2Fandroidgpr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatilshreyas%2Fandroidgpr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatilshreyas%2Fandroidgpr/lists"}