From 1b702ba998b761b467aa526cd86c135fb798fb79 Mon Sep 17 00:00:00 2001 From: Adrien Nguyen Date: Wed, 28 Apr 2021 19:38:47 +0200 Subject: [PATCH] update build process --- .github/workflows/maven-publish-release.yml | 33 +++++++++++++++++ ...publish.yml => maven-publish-snapshot.yml} | 6 ++-- .github/workflows/maven.yml | 36 ------------------- KinanCity-captcha-2captcha/pom.xml | 10 +++--- KinanCity-captcha-AntiCaptcha/pom.xml | 10 +++--- KinanCity-captcha-ImageTypers/pom.xml | 10 +++--- KinanCity-captcha-api/pom.xml | 6 ++-- KinanCity-captcha-client/pom.xml | 10 +++--- .../dependency-reduced-pom.xml | 4 +-- KinanCity-captcha-server/pom.xml | 10 +++--- KinanCity-core/Dockerfile | 11 ++++++ KinanCity-core/pom.xml | 26 +++++++------- KinanCity-core/scripts/install.sh | 2 ++ KinanCity-mail/pom.xml | 10 +++--- KinanCity-server/pom.xml | 6 ++-- KinanCity-utils/pom.xml | 6 ++-- pom.xml | 11 ++++-- ptc-api/pom.xml | 4 +-- 18 files changed, 113 insertions(+), 98 deletions(-) create mode 100644 .github/workflows/maven-publish-release.yml rename .github/workflows/{maven-publish.yml => maven-publish-snapshot.yml} (92%) delete mode 100644 .github/workflows/maven.yml create mode 100644 KinanCity-core/Dockerfile create mode 100644 KinanCity-core/scripts/install.sh diff --git a/.github/workflows/maven-publish-release.yml b/.github/workflows/maven-publish-release.yml new file mode 100644 index 0000000..ccbb37b --- /dev/null +++ b/.github/workflows/maven-publish-release.yml @@ -0,0 +1,33 @@ +# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created +# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path + +name: Maven Package Release + +on: + push: + branches: [ release ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + server-id: github # Value of the distributionManagement/repository/id field of the pom.xml + settings-path: ${{ github.workspace }} # location for the settings.xml file + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false \ No newline at end of file diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish-snapshot.yml similarity index 92% rename from .github/workflows/maven-publish.yml rename to .github/workflows/maven-publish-snapshot.yml index 5de62b4..776812e 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish-snapshot.yml @@ -1,11 +1,11 @@ # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created # For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path -name: Maven Package +name: Maven Package Develop Snapshot on: - release: - types: [created] + push: + branches: [ develop ] jobs: build: diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index 9ece568..0000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Develop Maven Build - -on: - push: - branches: [ develop ] - pull_request: - branches: [ develop ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build with Maven - run: mvn -B package --file pom.xml - - uses: actions/upload-artifact@v2 - with: - name: Kinan Core - path: KinanCity-core/target/KinanCity-core*.jar - - uses: actions/upload-artifact@v2 - with: - name: Kinan Mail - path: KinanCity-mail/target/KinanCity-mail*.jar - - uses: actions/upload-artifact@v2 - with: - name: Kinan Local Captcha - path: KinanCity-captcha-server/target/KinanCity-captcha-server*.jar diff --git a/KinanCity-captcha-2captcha/pom.xml b/KinanCity-captcha-2captcha/pom.xml index 61e4616..5fe3d05 100644 --- a/KinanCity-captcha-2captcha/pom.xml +++ b/KinanCity-captcha-2captcha/pom.xml @@ -3,16 +3,16 @@ 4.0.0 com.kinancity - KinanCity-parent - 1.4.2-SNAPSHOT + kinancity-parent + 1.5.0-SNAPSHOT - KinanCity-captcha-2captcha + kinancity-captcha-2captcha com.kinancity - KinanCity-captcha-api - 1.4.2-SNAPSHOT + kinancity-captcha-api + 1.5.0-SNAPSHOT diff --git a/KinanCity-captcha-AntiCaptcha/pom.xml b/KinanCity-captcha-AntiCaptcha/pom.xml index 79bfc84..d36f306 100644 --- a/KinanCity-captcha-AntiCaptcha/pom.xml +++ b/KinanCity-captcha-AntiCaptcha/pom.xml @@ -3,10 +3,10 @@ 4.0.0 com.kinancity - KinanCity-parent - 1.4.2-SNAPSHOT + kinancity-parent + 1.5.0-SNAPSHOT - KinanCity-captcha-AntiCaptcha + kinancity-captcha-anticaptcha @@ -18,8 +18,8 @@ com.kinancity - KinanCity-captcha-api - 1.4.2-SNAPSHOT + kinancity-captcha-api + 1.5.0-SNAPSHOT diff --git a/KinanCity-captcha-ImageTypers/pom.xml b/KinanCity-captcha-ImageTypers/pom.xml index adbf406..5aa8c53 100644 --- a/KinanCity-captcha-ImageTypers/pom.xml +++ b/KinanCity-captcha-ImageTypers/pom.xml @@ -3,17 +3,17 @@ 4.0.0 com.kinancity - KinanCity-parent - 1.4.2-SNAPSHOT + kinancity-parent + 1.5.0-SNAPSHOT - KinanCity-captcha-ImageTypers + kinancity-captcha-imagetypers com.kinancity - KinanCity-captcha-api - 1.4.2-SNAPSHOT + kinancity-captcha-api + 1.5.0-SNAPSHOT diff --git a/KinanCity-captcha-api/pom.xml b/KinanCity-captcha-api/pom.xml index 028c242..5c0ed01 100644 --- a/KinanCity-captcha-api/pom.xml +++ b/KinanCity-captcha-api/pom.xml @@ -3,10 +3,10 @@ 4.0.0 com.kinancity - KinanCity-parent - 1.4.2-SNAPSHOT + kinancity-parent + 1.5.0-SNAPSHOT - KinanCity-captcha-api + kinancity-captcha-api diff --git a/KinanCity-captcha-client/pom.xml b/KinanCity-captcha-client/pom.xml index 42fd9a3..92e0ae2 100644 --- a/KinanCity-captcha-client/pom.xml +++ b/KinanCity-captcha-client/pom.xml @@ -3,16 +3,16 @@ 4.0.0 com.kinancity - KinanCity-parent - 1.4.2-SNAPSHOT + kinancity-parent + 1.5.0-SNAPSHOT - KinanCity-captcha-client + kinancity-captcha-client com.kinancity - KinanCity-captcha-AntiCaptcha - 1.4.2-SNAPSHOT + kinancity-captcha-anticaptcha + 1.5.0-SNAPSHOT diff --git a/KinanCity-captcha-server/dependency-reduced-pom.xml b/KinanCity-captcha-server/dependency-reduced-pom.xml index 1d3cee6..e727fe4 100644 --- a/KinanCity-captcha-server/dependency-reduced-pom.xml +++ b/KinanCity-captcha-server/dependency-reduced-pom.xml @@ -1,12 +1,12 @@ - KinanCity-parent + kinancity-parent com.kinancity 1.3.3-SNAPSHOT 4.0.0 - KinanCity-captcha-server + kinancity-captcha-server diff --git a/KinanCity-captcha-server/pom.xml b/KinanCity-captcha-server/pom.xml index eeb4d34..49855fe 100644 --- a/KinanCity-captcha-server/pom.xml +++ b/KinanCity-captcha-server/pom.xml @@ -3,11 +3,11 @@ 4.0.0 com.kinancity - KinanCity-parent - 1.4.2-SNAPSHOT + kinancity-parent + 1.5.0-SNAPSHOT - KinanCity-captcha-server + kinancity-captcha-server @@ -40,8 +40,8 @@ com.kinancity - KinanCity-captcha-AntiCaptcha - 1.4.2-SNAPSHOT + kinancity-captcha-anticaptcha + 1.5.0-SNAPSHOT org.springframework diff --git a/KinanCity-core/Dockerfile b/KinanCity-core/Dockerfile new file mode 100644 index 0000000..3a092e6 --- /dev/null +++ b/KinanCity-core/Dockerfile @@ -0,0 +1,11 @@ +FROM openjdk:8 +MAINTAINER drallieiv + +VOLUME ["/opt/data"] + +RUN apt-get update && apt-get install -y --no-install-recommends curl wget && rm -rf /var/lib/apt/lists/* + +# Download last KinanCity core jar +RUN curl -s https://api.github.com/repos/drallieiv/KinanCity/releases | grep "browser_download_url" | grep "KinanCity-core" | grep "jar" | head -n 1 | cut -d '"' -f 4 | xargs wget -O KinanCity-core.jar + +ENTRYPOINT ["java" "-jar KinanCity-core.jar -o /opt/data/result.csv"] diff --git a/KinanCity-core/pom.xml b/KinanCity-core/pom.xml index b050598..c3a529a 100644 --- a/KinanCity-core/pom.xml +++ b/KinanCity-core/pom.xml @@ -3,11 +3,11 @@ 4.0.0 com.kinancity - KinanCity-parent - 1.4.2-SNAPSHOT + kinancity-parent + 1.5.0-SNAPSHOT - KinanCity-core + kinancity-core Core module for KinanCity @@ -21,32 +21,32 @@ com.kinancity - KinanCity-utils - 1.4.2-SNAPSHOT + kinancity-utils + 1.5.0-SNAPSHOT com.kinancity - KinanCity-captcha-2captcha - 1.4.2-SNAPSHOT + kinancity-captcha-2captcha + 1.5.0-SNAPSHOT com.kinancity - KinanCity-captcha-ImageTypers - 1.4.2-SNAPSHOT + kinancity-captcha-imagetypers + 1.5.0-SNAPSHOT com.kinancity - KinanCity-captcha-AntiCaptcha - 1.4.2-SNAPSHOT + kinancity-captcha-anticaptcha + 1.5.0-SNAPSHOT com.kinancity - KinanCity-captcha-client - 1.4.2-SNAPSHOT + kinancity-captcha-client + 1.5.0-SNAPSHOT diff --git a/KinanCity-core/scripts/install.sh b/KinanCity-core/scripts/install.sh new file mode 100644 index 0000000..e9ede27 --- /dev/null +++ b/KinanCity-core/scripts/install.sh @@ -0,0 +1,2 @@ +#!/bin/sh +curl -s https://api.github.com/repos/drallieiv/KinanCity/releases | grep "browser_download_url" | grep "KinanCity-core" | grep "jar" | head -n 1 | cut -d '"' -f 4 | xargs wget -O KinanCity-core.jar \ No newline at end of file diff --git a/KinanCity-mail/pom.xml b/KinanCity-mail/pom.xml index c06132b..48fac70 100644 --- a/KinanCity-mail/pom.xml +++ b/KinanCity-mail/pom.xml @@ -1,12 +1,12 @@ - + 4.0.0 com.kinancity - KinanCity-parent - 1.4.2-SNAPSHOT + kinancity-parent + 1.5.0-SNAPSHOT - KinanCity-mail + kinancity-mail 2.0.2 Email validation for KinanCity diff --git a/KinanCity-server/pom.xml b/KinanCity-server/pom.xml index 0a9a374..d821542 100644 --- a/KinanCity-server/pom.xml +++ b/KinanCity-server/pom.xml @@ -3,10 +3,10 @@ 4.0.0 com.kinancity - KinanCity-parent + kinancity-parent 1.3.3-SNAPSHOT - KinanCity-server + kinancity-server @@ -25,7 +25,7 @@ com.kinancity - KinanCity-core + kinancity-core ${project.version} diff --git a/KinanCity-utils/pom.xml b/KinanCity-utils/pom.xml index e688885..ad943fa 100644 --- a/KinanCity-utils/pom.xml +++ b/KinanCity-utils/pom.xml @@ -3,10 +3,10 @@ 4.0.0 com.kinancity - KinanCity-parent - 1.4.2-SNAPSHOT + kinancity-parent + 1.5.0-SNAPSHOT - KinanCity-utils + kinancity-utils diff --git a/pom.xml b/pom.xml index 63a47ac..143e2c7 100644 --- a/pom.xml +++ b/pom.xml @@ -3,13 +3,18 @@ 4.0.0 com.kinancity - KinanCity-parent - 1.4.2-SNAPSHOT + kinancity-parent + 1.5.0-SNAPSHOT pom Kinan City https://github.com/drallieiv/KinanCity + + https://github.com/drallieiv/KinanCity + scm:git:git@github.com:drallieiv/KinanCity.git + + 1.8 1.8 @@ -28,7 +33,7 @@ KinanCity-captcha-server KinanCity-captcha-client - + github diff --git a/ptc-api/pom.xml b/ptc-api/pom.xml index 949eb48..ac8a3a3 100644 --- a/ptc-api/pom.xml +++ b/ptc-api/pom.xml @@ -3,8 +3,8 @@ 4.0.0 com.kinancity - KinanCity-parent - 1.4.2-SNAPSHOT + kinancity-parent + 1.5.0-SNAPSHOT ptc-api PTC account creation API