Skip to content

Commit

Permalink
Merge pull request #11 from DarviL82/dev
Browse files Browse the repository at this point in the history
Add Repsy repository
  • Loading branch information
darvil82 authored Nov 7, 2023
2 parents 2413530 + c471e10 commit 857cb24
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 28 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish to Github Packages
name: Publish Package

on:
workflow_dispatch:
Expand All @@ -14,8 +14,10 @@ jobs:
env:
CI_GITHUB: 'x'
CI_GITHUB_BRANCH: ${{ github.ref_name }}
CI_GITHUB_USERNAME: ${{ github.actor }}
CI_GITHUB_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_GithubUsername: ${{ github.actor }}
ORG_GRADLE_PROJECT_GithubPassword: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_RepsyUsername: darvil
ORG_GRADLE_PROJECT_RepsyPassword: ${{ secrets.REPSY_PASSWORD }}

runs-on: ubuntu-latest

Expand Down
45 changes: 28 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div align="center">
<div>
<img src="https://github.com/DarviL82/Lanat/assets/48654552/33f9a03d-1ce3-49f0-839d-475e35d9e816" width="450">
<img alt="Lanat logo" src="https://github.com/DarviL82/Lanat/assets/48654552/33f9a03d-1ce3-49f0-839d-475e35d9e816" width="450">
</div>
<br>
<strong>
Expand Down Expand Up @@ -65,18 +65,35 @@ Deep documentation and tutorials comming soon.

## Installation

The package is currently only available on GitHub Packages.
The package is currently available on Repsy and GitHub Packages.

### Gradle
1. Add the following to your `repositories` block:
```kotlin
maven("https://repsy.io/mvn/darvil/java")
```

2. And add the following to your `dependencies` block:
```kotlin
implementation("com.darvil:lanat:+")
```
> [!NOTE]
> The `+` symbol is a wildcard that will automatically use the latest version of the package.
> You can also specify a specific version (e.g. `0.1.0`).

<details>

<summary><strong>Install from Github Packages</strong></summary>

If using Gradle, follow these steps:

1. Authenticate to GitHub Packages to be able to download the package. You can do this by adding the following to your [gradle.properties](https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties) file:

```
gpr.user=USERNAME
gpr.key=PERSONAL_ACCESS_TOKEN
```
```
gpr.user=USERNAME
gpr.key=PERSONAL_ACCESS_TOKEN
```

Replace `USERNAME` with your GitHub username and `PERSONAL_ACCESS_TOKEN` with a personal access token that has the `read:packages` scope.
Replace `USERNAME` with your GitHub username and `PERSONAL_ACCESS_TOKEN` with a personal access token that has the `read:packages` scope.

2. Add the following inside your `repositories` block:

Expand All @@ -90,16 +107,10 @@ The package is currently only available on GitHub Packages.
}
```

3. And add the following to your `dependencies` block:

```kotlin
implementation("darvil:lanat")
```
> [!NOTE]
> You may need to explicitly specify the version of the package you want to use. (e.g. `darvil:lanat:x.x.x`).
3. Follow step 2 from the previous section.

This information is available at the [GitHub Packages documentation](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package).

### Other build tools
For other build tools, see [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-gradle-registry#using-a-published-package).

See [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry).
</details>
18 changes: 10 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
`maven-publish`
}

group = "darvil"
group = "com.darvil"
version = "0.1.0"
description = "Command line argument parser"

Expand All @@ -27,19 +27,21 @@ repositories {
publishing {
repositories {
maven {
name = "github"
name = "Github"
url = uri("https://maven.pkg.github.com/darvil82/Lanat")
credentials {
username = System.getenv("CI_GITHUB_USERNAME")
password = System.getenv("CI_GITHUB_PASSWORD")
}
credentials(PasswordCredentials::class)
}

maven {
name = "Repsy"
url = uri("https://repsy.io/mvn/darvil/java")
credentials(PasswordCredentials::class)
}
}

publications {
register<MavenPublication>("gpr") {
create<MavenPublication>("mavenJava") {
from(components["java"])
artifactId = rootProject.name
}
}
}
Expand Down

0 comments on commit 857cb24

Please sign in to comment.