Skip to content

Commit

Permalink
fix(ci): deploy to another repository
Browse files Browse the repository at this point in the history
  • Loading branch information
CatCoderr committed Oct 9, 2024
1 parent 257a682 commit 6d2ddf2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ name: Build

on: [ push ]

env:
GPG_KEY_NAME: ${{ secrets.GPG_KEY_NAME }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_OSSRH_DEPLOYER }}
SONATYPE_TOKEN: ${{ secrets.SONATYPE_OSSRH_TOKEN }}

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -26,11 +19,12 @@ jobs:
- name: Build with Gradle
run: ./gradlew test build --no-daemon

- name: Publish to Sonatype
- name: Publish with Gradle
if: github.ref == 'refs/heads/master'
env:
GPG_PASSPHRASE: ${{ secrets.GPG_KEY_PASSPHRASE }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
USERNAME: ${{ secrets.REPO_USER }}
TOKEN: ${{ secrets.REPO_TOKEN }}

run: ./gradlew publish --no-daemon
13 changes: 8 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<p align="center">
<a target="_blank"><img src="https://github.com/CatCoderr/ProtocolSidebar/actions/workflows/build.yaml/badge.svg" alt="Build" /></a>
<a target="_blank"><img src="https://img.shields.io/github/license/CatCoderr/ProtocolSidebar" alt="License" /></a>
<a target="_blank"><img src="https://img.shields.io/nexus/s/me.catcoder/bukkit-sidebar?server=https%3A%2F%2Foss.sonatype.org" alt="Nexus" /></a>
<a target="_blank"><img src="https://img.shields.io/badge/Minecraft%20Versions-1.12.2--1.21-blue?style=flat" alt="Minecraft Versions" /></a>
</p>

Expand All @@ -24,6 +23,10 @@

![Sidebar](https://github.com/CatCoderr/ProtocolSidebar/raw/master/assets/sidebar.gif)

⚠️ **Note**: starting from **6.2.7-SNAPSHOT** version, the repository has been moved to https://catcoder.pl.ua/snapshots.
You can find URL for Maven and Gradle in the [Adding to your project](#adding-to-your-project) section.


## Donations
[![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-Donate%20Now-yellow?style=for-the-badge&logo=buy-me-a-coffee)](https://www.buymeacoffee.com/catcoderr)

Expand Down Expand Up @@ -58,8 +61,8 @@ or [maven-shade-plugin](https://maven.apache.org/plugins/maven-shade-plugin/) (f

```xml
<repository>
<id>sonatype-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<id>catcoder-snapshots</id>
<url>https://catcoder.pl.ua/snapshots</url>
</repository>
```
```xml
Expand All @@ -74,7 +77,7 @@ or [maven-shade-plugin](https://maven.apache.org/plugins/maven-shade-plugin/) (f

```groovy
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots/' }
maven { url 'https://catcoder.pl.ua/snapshots' }
}
```
```groovy
Expand All @@ -87,7 +90,7 @@ dependencies {

```kotlin
repositories {
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://catcoder.pl.ua/snapshots")
}
```
```kotlin
Expand Down
15 changes: 8 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
plugins {
id("java-library")
id("maven-publish")
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id("signing")
}

group = "me.catcoder"
version = "6.2.7-SNAPSHOT"
description = "Powerful feature-packed Minecraft scoreboard library"

extra["sonatypeUsername"] = System.getenv("SONATYPE_USERNAME")
extra["sonatypePassword"] = System.getenv("SONATYPE_PASSWORD")

val adventureVersion = "4.16.0"
val paperVersion = "1.20.1-R0.1-SNAPSHOT"
val viaVersionVersion = "4.8.1"
Expand Down Expand Up @@ -105,11 +101,16 @@ publishing {
}
}
}
}

nexusPublishing {
repositories {
sonatype()
maven {
name = "Snapshots"
url = uri("https://catcoder.pl.ua/snapshots")
credentials {
username = System.getenv("USERNAME")
password = System.getenv("TOKEN")
}
}
}
}

Expand Down

0 comments on commit 6d2ddf2

Please sign in to comment.