{"id":15654828,"url":"https://github.com/er1c/sbt-github","last_synced_at":"2025-05-01T09:07:22.580Z","repository":{"id":53479931,"uuid":"327434616","full_name":"er1c/sbt-github","owner":"er1c","description":"sbt plugin for GitHub Packages, publish packaged jars or remote cache artifacts","archived":false,"fork":false,"pushed_at":"2025-01-10T15:00:57.000Z","size":391,"stargazers_count":16,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-30T21:05:05.917Z","etag":null,"topics":["github","sbt","sbt-plugin","scala"],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/er1c.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-06T21:36:43.000Z","updated_at":"2025-03-29T21:06:00.000Z","dependencies_parsed_at":"2025-03-09T17:42:46.418Z","dependency_job_id":null,"html_url":"https://github.com/er1c/sbt-github","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/er1c%2Fsbt-github","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/er1c%2Fsbt-github/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/er1c%2Fsbt-github/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/er1c%2Fsbt-github/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/er1c","download_url":"https://codeload.github.com/er1c/sbt-github/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251848870,"owners_count":21653755,"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":["github","sbt","sbt-plugin","scala"],"created_at":"2024-10-03T12:54:21.607Z","updated_at":"2025-05-01T09:07:22.529Z","avatar_url":"https://github.com/er1c.png","language":"Scala","readme":"sbt-github\n----------\n[![Continuous Integration](https://github.com/er1c/sbt-github/actions/workflows/ci.yml/badge.svg)](https://github.com/er1c/sbt-github/actions/workflows/ci.yml)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.github.er1c/sbt-github/badge.svg)](https://search.maven.org/search?q=g:io.github.er1c%20AND%20a:sbt-github)\n\n\nForking/refactoring [`sbt-bintray`](https://github.com/sbt/sbt-bintray) for GitHub support\n\n- Requirements: sbt `1.2.1` or later.\n\nSee [remote caching](REMOTE_CACHE.md) for information about sbt-github-remote-cache.\n\n## Install\n\n### What you need\n\nAdd the following to your sbt `project/plugins.sbt` file:\n\n```scala\naddSbtPlugin(\"io.github.er1c\" % \"sbt-github\" % \"0.3.0\")\n```\n\n## Usage\n\nNote that when specifying `sbt-github` settings in `project/*.scala` files (as opposed to in `build.sbt`), you will need to add the following import:\n\n```scala\nimport github.GitHubPluginKeys._\n```\n\n### Reading Packages\n\n```scala\nresolvers += \"github-packages-tests\" at \"https://maven.pkg.github.com/er1c/github-packages-tests\"\ngithubTokenSource := TokenSource.Environment(\"GITHUB_TOKEN\") // optional since this is in the default chain\nlibraryDependencies += \"com.example\" % \"java-project-example\" % \"0.1.0\"\n```\n\n### GitHub User\n\n```scala\nThisBuild / githubOwner := \"er1c\"\nThisBuild / githubOwnerType := GitHubOwnerType.User\nThisBuild / githubRepository := \"sbt-github\"\n```\n\n### GitHub Organization\n\n```scala\nThisBuild / githubOwner := \"sbt\"\nThisBuild / githubOwnerType := GitHubOwnerType.Organization\nThisBuild / githubRepository := \"io\"\n```\n\n### Publishing\n\nTo publish a package to github, you need a github account. You can register for one [here](https://github.com/signup/index). \n`GitHubPlugin` is an auto plugin that will be added to all projects in your build.\nThis plugin will upload and release your artifacts into github when you run `publish`.\n\nTo exclude a project from being published (for example a root or a tests project) use the `skip` setting:\n\n```scala\npublish / skip := true\n```\n\nAt any time you can check who you will be authenticated as with the `githubWhoami` setting which will print your github username\n\n    \u003e githubWhoami\n\n#### Credentials\n\nTo publish, you need to provide github credentials (user name and API key). There are three ways to set them up: credential file, properties, and environment variables.\n\nThe default chain is:\n\n```scala\n    githubTokenSource :=\n      TokenSource.Property(\"github.token\") ||\n        TokenSource.Environment(\"GITHUB_TOKEN\") ||\n        TokenSource.GitConfig(\"github.token\"),\n```\n\nWith a fall back to the `~/.github/.credentials` file.\n\n1. Credentials file\n\nsbt-github will look for a credentials file under `~/.github/.credentials` used to authenticate publishing requests to github.\n\n```\nrealm = GitHub API Realm\nhost = api.github.com\nuser = \u003cgithub user\u003e\npassword = \u003capi_token\u003e\n```\n\nYou can interactively set up or change the github credentials used by sbt anytime with\n\n    \u003e githubChangeCredentials\n\nNote you will need to `reload` your project afterwards which will reset your `publishTo` setting.\n\n2.  Properties\n\nYou can pass the user and pass as JVM properties when starting sbt:\n\n    sbt -Dgithub.token=yourgithubtoken\n    \n3. Environment variables\n\nsbt-github will look for github token in the environment variable `GITHUB_TOKEN`.\n\n3. Git Config\n\nsbt-github will look in git config in the path `github.token`.\n\n4. Alternatively, you can also specify the credentials in your `~/.sbt/1.0/credentials.sbt`, and use file:\n\n```scala\ncredentials +=\n  Credentials(\n    \"GitHub Package Registry\",\n    \"maven.pkg.github.com\",\n    \"USERNAME\",\n    \"TOKEN\")\n```\n\n#### github organization\n\nYou may optionally wish to publish to a [github organization](https://github.com/docs/usermanual/interacting/interacting_githuborganizations.html)\ninstead of your individual github user account. To do so, use the `githubOrganization` setting in your project's build definition.\n\n```scala\ngithubOwner := Some(\"strength-in-numbers\")\ngithubOwnerType := GitHubOwnerType.Organization\n```\n\nThe default GitHub repository, for a github user or organization is named `maven`. If your Maven repository is named differently, you will need to specify the `githubRepository` setting.\n\n```scala\ngithubRepository := \"oss-maven\"\n```\n\n##### Public (default)\n\nIf your project uses a license, github supports several [OSS licenses](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository). If you are new to software licenses you may\nwant to grab a coffee and absorb some [well organized information](http://choosealicense.com/) on the topic of choice.\nSbt already defines a `licenses` setting key. In order to use github sbt you must define your `licenses` key to contain a license with a name matching\none of those github defines. I recommend [MIT](http://choosealicense.com/licenses/mit/).\n\n```scala\nlicenses += (\"MIT\", url(\"http://opensource.org/licenses/MIT\"))\n```\n\n### Unpublishing\n\nIt's generally a bad practice to remove a version of a library others may depend on but sometimes you may want test a release with the ability to immediately take it back down if something goes south before others start depending on it. github allows for this flexibility and thus, sbt-github does as well. Use the `unpublish` task to unpublish the current version from github.\n\n    \u003e githubUnpublish\n\n### Finding your way around\n\nThe easiest way to learn about sbt-github is to use the sbt shell typing `github\u003ctab\u003e` or `help github` to discover github keys.\n\n## Acknowledgments\n\nThis plugin was first created by Doug Tangren (softprops), 2013-2014.\n\nThe plugin is now maintained by [er1c](https://github.com/er1c).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fer1c%2Fsbt-github","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fer1c%2Fsbt-github","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fer1c%2Fsbt-github/lists"}