Skip to content

Commit

Permalink
Added first commit in org.jimdo
Browse files Browse the repository at this point in the history
  • Loading branch information
JUAN CASTAÑEDA committed Jul 21, 2023
1 parent 8fdf39e commit dd3dc2c
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 61 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI/CD

on:
push:
tags:
- '*'

jobs:
release_and_publish:
name: Release and Publish
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '1.8' # Adjust the Java version to your project's requirements

- name: Build Project
run: ./gradlew build

- name: Generate Release and Publish Package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# GPR_USER: "jimdo-bot"
# GPR_TOKEN: ${{ secrets.GPR_TOKEN }}
run: |
./gradlew release -Prelease.useAutomaticVersion=true
# ./gradlew publish

#jobs:
# test:
# name: Test
# runs-on: ubuntu-latest
# steps:
# - name: Check out code
# uses: actions/checkout@v2
# with:
# persist-credentials: false
#
# - name: Set up JDK 11
# uses: actions/[email protected]
# with:
# distribution: 'zulu'
# java-version: '11'
# cache: 'gradle'
#
# - name: Run tests
# run: ./gradlew check
#
# publish:
# name: Publish
# needs:
# - test
# runs-on: ubuntu-latest
# steps:
# - name: Check out code
# uses: actions/checkout@v2
# with:
# persist-credentials: false
#
# - name: Set up JDK 11
# uses: actions/[email protected]
# with:
# distribution: 'zulu'
# java-version: '11'
# cache: 'gradle'
#
# - name: Publish snapshot
# if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')
# run: make publish-snapshot
# env:
# BRANCH: ${GITHUB_REF#refs/heads/}
# USERNAME: "jimdo-bot"
# TOKEN: ${{ secrets.TOKEN }}
#
# - name: Publish
# if: startsWith(github.ref, 'refs/tags/')
# run: make publish
# env:
# USERNAME: "jimdo-bot"
# TOKEN: ${{ secrets.TOKEN }}
15 changes: 0 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version := "0.0.2"

target_data_directory := lib/src/main/resources/
target_po_directory := lib/src/main/resources/iso_3166/
Expand Down Expand Up @@ -29,17 +28,3 @@ delete-po-and-mo:

.PHONY: get-latest-iso-files
get-latest-iso-files: clone-iso-codes transpile-translations delete-po-and-mo

# Generating deployable
.PHONY: generate-artifacts
generate-artifacts:
JCOUNTRY_VERSION=${version} ./gradlew build

.PHONY: generate-pom
publish-to-ossrh:
OSSRH_USER=${OSSRH_USER} \
OSSRH_PASS=${OSSRH_PASS} \
GPG_SIGNING_KEY_PASSWORD=${GPG_SIGNING_KEY_PASSWORD} \
GPG_SIGNING_KEY=${GPG_SIGNING_KEY} \
JCOUNTRY_VERSION=${version} \
./gradlew publish
15 changes: 2 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,11 @@ This will help having a quick source for translations of country names, and the
For the status of the translations, please check the [iso codes](https://github.com/sailfishos-mirror/iso-codes) repository (which is the original source of the iso files and translations).

## Dependency
```java
// Maven
<dependency>
<groupId>io.github.castmart</groupId>
<artifactId>jcountry</artifactId>
<version>0.0.2</version>
</dependency>
```
```kotlin
// Gradle Kotlin
implementation("io.github.castmart:jcountry:0.0.2")
```
```java
// Gradle short
implementation 'io.github.castmart:jcountry:0.0.2'
implementation("com.jimdo:jcountry:0.1.0")
```

## How to use it?
```java
JCountry jcountry = new JCountry();
Expand Down
39 changes: 14 additions & 25 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,25 @@
* User Manual available at https://docs.gradle.org/7.6.1/userguide/building_java_projects.html
* This project uses @Incubating APIs which are subject to change.
*/
group = "io.github.castmart"
version = "${System.getenv("JCOUNTRY_VERSION")}"
group = "com.jimdo"

plugins {
// Apply the java-library plugin for API and implementation separation.
signing
`java-library`
`maven-publish`
id("pl.allegro.tech.build.axion-release") version "1.15.3"
}

// TO BE UPDATED ON EVERY RELEASE.
version = scmVersion.version

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}

dependencies {
// This dependency is exported to consumers, that is to say found on their compile classpath.
// api("org.apache.commons:commons-math3:3.6.1")

// This dependency is used internally, and not exposed to consumers on their own compile classpath.
// implementation("com.google.guava:guava:31.1-jre")
implementation("org.json:json:20230618")

testImplementation("org.junit.jupiter:junit-jupiter-engine:5.9.2")
}

Expand All @@ -53,18 +49,12 @@ afterEvaluate {
publishing {
publications {
create<MavenPublication>("jcountry") {
signing {
val signingKey: String = "${System.getenv("GPG_SIGNING_KEY")}"
val signingPassword: String = "${System.getenv("GPG_SIGNING_KEY_PASSWORD")}"
useInMemoryPgpKeys(signingKey, signingPassword)
sign(publishing.publications["jcountry"])
}
artifactId = "jcountry"
from(components["java"])
pom {
name.set("jcountry")
description.set("A java wrapper for the ISO country codes and translations inspired in pycountry")
url.set("https://github.com/castmart/jcountry")
url.set("https://github.com/Jimdo/jcountry")
licenses {
license {
name.set("GNU LESSER GENERAL PUBLIC LICENSE, Version 2.1")
Expand All @@ -75,26 +65,25 @@ afterEvaluate {
developer {
id.set("castmart")
name.set("Juan Carlos Castaneda Martinez")
email.set("jc.castmart@gmail.com")
email.set("juan.castaneda@jimdo.com")
}
}
scm {
connection.set("scm:git:https://github.com/castmart/jcountry.git")
developerConnection.set("scm:git:https://github.com/castmart/jcountry.git")
url.set("https://github.com/castmart/jcountry")
connection.set("scm:git:https://github.com/Jimdo/jcountry.git")
developerConnection.set("scm:git:https://github.com/Jimdo/jcountry.git")
url.set("https://github.com/Jimdo/jcountry")
}
}
}
}

repositories {
maven {
// url = uri(layout.buildDirectory.dir("repo"))
name = "OSSRH"
url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/jimdo/packages")
credentials {
username = "${System.getenv("OSSRH_USER")}"
password = "${System.getenv("OSSRH_PASS")}"
username = "${System.getenv("MAVEN_USERNAME")}"
password = "${System.getenv("MAVEN_PASSWORD")}"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.castmart.jcountry;
package com.jimdo.jcountry;

/**
* Model Class to store Country Information. ISO-3166-1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.castmart.jcountry;
package com.jimdo.jcountry;

import java.util.HashMap;
import java.util.Locale;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.castmart.jcountry;
package com.jimdo.jcountry;

import java.io.InputStream;
import java.util.*;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package io.github.castmart.jcountry;
package com.jimdo.jcountry;

/**
* Singleton class that loads the ISO DB's through the corresponding Classes.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.castmart.jcountry;
package com.jimdo.jcountry;

/**
* Model Class to store Country Information. ISO-639-2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.castmart.jcountry;
package com.jimdo.jcountry;

import java.util.HashMap;
import java.util.Locale;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.github.castmart.jcountry;
package com.jimdo.jcountry;

import org.json.JSONArray;
import org.json.JSONObject;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* This Java source file was generated by the Gradle 'init' task.
*/
package io.github.castmart.jcountry;
package com.jimdo.jcountry;

import org.junit.jupiter.api.Test;

Expand Down

0 comments on commit dd3dc2c

Please sign in to comment.