Add PUBLISHING.md
This commit is contained in:
192
PUBLISHING.md
Normal file
192
PUBLISHING.md
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
# Erato Rate Limit Starter - Yayınlama Rehberi
|
||||||
|
|
||||||
|
## 🏠 Local Maven Repository
|
||||||
|
|
||||||
|
En basit yöntem - diğer projelerinizde hemen kullanabilirsiniz:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mvn clean install
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🏢 Private Nexus/Artifactory
|
||||||
|
|
||||||
|
### 1. pom.xml'e distribution management ekleyin:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>erato-releases</id>
|
||||||
|
<url>https://nexus.erato.com.tr/repository/maven-releases/</url>
|
||||||
|
</repository>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>erato-snapshots</id>
|
||||||
|
<url>https://nexus.erato.com.tr/repository/maven-snapshots/</url>
|
||||||
|
</snapshotRepository>
|
||||||
|
</distributionManagement>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Deploy:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mvn clean deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🐙 GitHub Packages
|
||||||
|
|
||||||
|
### 1. pom.xml güncelleme:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>github</id>
|
||||||
|
<n>GitHub Packages</n>
|
||||||
|
<url>https://maven.pkg.github.com/erato/rate-limit-starter</url>
|
||||||
|
</repository>
|
||||||
|
</distributionManagement>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. GitHub Actions workflow (.github/workflows/maven-publish.yml):
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: Publish Package
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [created]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Set up JDK 17
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
java-version: '17'
|
||||||
|
distribution: 'temurin'
|
||||||
|
|
||||||
|
- name: Publish to GitHub Packages
|
||||||
|
run: mvn deploy
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🗂️ Shared File System
|
||||||
|
|
||||||
|
Küçük takımlar için basit çözüm:
|
||||||
|
|
||||||
|
### 1. pom.xml:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>file-repo</id>
|
||||||
|
<url>file:///shared/maven-repo</url>
|
||||||
|
</repository>
|
||||||
|
</distributionManagement>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Deploy:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mvn clean deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Diğer projelerde kullanım:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>shared-repo</id>
|
||||||
|
<url>file:///shared/maven-repo</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🐳 Docker Registry (JIB)
|
||||||
|
|
||||||
|
### 1. pom.xml'e JIB plugin ekleyin:
|
||||||
|
|
||||||
|
```xml
|
||||||
|
<plugin>
|
||||||
|
<groupId>com.google.cloud.tools</groupId>
|
||||||
|
<artifactId>jib-maven-plugin</artifactId>
|
||||||
|
<version>3.3.2</version>
|
||||||
|
<configuration>
|
||||||
|
<to>
|
||||||
|
<image>registry.erato.com.tr/rate-limit-starter:${project.version}</image>
|
||||||
|
</to>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Build & Push:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mvn compile jib:build
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📦 Manual JAR Distribution
|
||||||
|
|
||||||
|
### 1. JAR oluştur:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mvn clean package
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Diğer projelerde kullanım:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# JAR'ı lib klasörüne kopyala
|
||||||
|
mkdir -p lib
|
||||||
|
cp erato-rate-limit-spring-boot-starter-1.0.0.jar lib/
|
||||||
|
|
||||||
|
# pom.xml'e system dependency ekle
|
||||||
|
<dependency>
|
||||||
|
<groupId>tr.com.erato</groupId>
|
||||||
|
<artifactId>erato-rate-limit-spring-boot-starter</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>system</scope>
|
||||||
|
<systemPath>${project.basedir}/lib/erato-rate-limit-spring-boot-starter-1.0.0.jar</systemPath>
|
||||||
|
</dependency>
|
||||||
|
```
|
||||||
|
|
||||||
|
## 🔑 Güvenlik
|
||||||
|
|
||||||
|
Repository credentials için environment variables kullanın:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
export NEXUS_USERNAME=your-username
|
||||||
|
export NEXUS_PASSWORD=your-password
|
||||||
|
mvn deploy
|
||||||
|
```
|
||||||
|
|
||||||
|
Veya `~/.m2/settings.xml` dosyasında saklayın.
|
||||||
|
|
||||||
|
## 🏷️ Versioning
|
||||||
|
|
||||||
|
Semantic versioning kullanın:
|
||||||
|
|
||||||
|
- **1.0.0** - İlk stable release
|
||||||
|
- **1.0.1** - Bug fixes
|
||||||
|
- **1.1.0** - Yeni özellikler (backward compatible)
|
||||||
|
- **2.0.0** - Breaking changes
|
||||||
|
|
||||||
|
Version güncelleme:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mvn versions:set -DnewVersion=1.0.1
|
||||||
|
mvn versions:commit
|
||||||
|
```
|
||||||
|
|
||||||
|
## 📋 Release Checklist
|
||||||
|
|
||||||
|
- [ ] Testler geçiyor mu? `mvn test`
|
||||||
|
- [ ] Javadoc complete mi? `mvn javadoc:javadoc`
|
||||||
|
- [ ] README güncel mi?
|
||||||
|
- [ ] CHANGELOG eklendi mi?
|
||||||
|
- [ ] Version number doğru mu?
|
||||||
|
- [ ] Tag oluşturuldu mu? `git tag v1.0.0`
|
||||||
|
- [ ] Deploy edildi mi? `mvn deploy`
|
||||||
Reference in New Issue
Block a user