diff --git a/.github/workflows/deploy b/.github/workflows/deploy deleted file mode 100644 index 842159cf7..000000000 --- a/.github/workflows/deploy +++ /dev/null @@ -1,47 +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: Java CI with Maven - -on: - push: - branches: [master] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 17.0.2 - uses: actions/setup-java@v2 - with: - java-version: '17.0.2' - distribution: 'adopt' - - name: Build with Maven - run: mvn clean deploy --file pom.xml -s ci_settings.xml - env: - APIDOCS_PASS: ${{ secrets.JAVADOCS_USER }} - APIDOCS_USER: ${{ secrets.JAVADOCS_PASS }} -# - name: release -# uses: actions/create-release@v1 -# id: create_release -# with: -# draft: false -# prerelease: false -# release_name: Release ${{ github.ref }} -# tag_name: ${{ github.ref }} -# body_path: CHANGELOG.md -# env: -# GITHUB_TOKEN: ${{ github.token }} -# - name: upload plugin jar artifact -# uses: actions/upload-release-asset@v1 -# env: -# GITHUB_TOKEN: ${{ github.token }} -# with: -# upload_url: ${{ steps.create_release.outputs.upload_url }} -# asset_path: ./bedwars-plugin/target/bedwars-plugin-*.jar -# asset_name: bedwars-plugin.jar -# asset_content_type: application/jar -# prerelease: false diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 000000000..e6caf36d9 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,45 @@ +name: Deploy with Maven + +on: + push: + branches: [production] + +jobs: + build: + runs-on: ubuntu-latest + environment: + name: production + url: https://repo.andrei1058.com + steps: + - uses: actions/checkout@v2 + - name: Set up JDK 17.0.2 + uses: actions/setup-java@v2 + with: + java-version: '17.0.2' + distribution: 'adopt' + - name: Deploy with Maven + env: + MVN_REPO_USER: ${{ secrets.MVN_REPO_USER }} + MVN_REPO_PASS: ${{ secrets.MVN_REPO_PASS }} + ANDEV_API_TOKEN: ${{ secrets.ANDEV_API_TOKEN }} + J_DOCS_USER: ${{ secrets.J_DOCS_USER }} + J_DOCS_PASS: ${{ secrets.J_DOCS_PASS }} + POLY_API_KEY: ${{ secrets.POLY_API_KEY }} + run: | + sudo apt install jq -y + curl -X PUT https://api.andrei1058.dev/v1/resources/1/versioning/commit -H "Accept: application/json" -H "Authorization: Bearer ${{ secrets.ANDEV_API_TOKEN }}" -H "Content-Type: application/json" --data '{"confirmation": true}' >> version.json + export UPDATE_VERSION=`jq '.version' version.json | tr -d '"'` + mvn versions:set -DnewVersion=$UPDATE_VERSION + mvn versions:update-child-modules + mvn clean deploy -s ci_settings.xml + mvn javadoc:javadoc + sudo apt install -y -qq lftp + lftp -c "set ftp:ssl-allow no; open -u $J_DOCS_USER,$J_DOCS_PASS javadocs.andrei1058.dev; mirror -Rev bedwars-api/target/site/apidocs ./BedWars1058 --ignore-time --parallel=10 --exclude-glob .git* --exclude .git/" + curl -F "file=@bedwars-plugin/target/bedwars-plugin-$UPDATE_VERSION.jar" -F api_key=$POLY_API_KEY -F resource_id="1152" -F version="$UPDATE_VERSION" -F title="v$UPDATE_VERSION" -F message="For a detailed update log please visit https://github.com/andrei1058/BedWars1058/releases" "https://api.polymart.org/v1/postUpdate" + echo $UPDATE_VERSION >> $GITHUB_ENV + - name: Create Tag + uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true + name: ${{env.UPDATE_VERSION}} + tag_name: ${{env.UPDATE_VERSION}} \ No newline at end of file diff --git a/.github/workflows/maven.yml b/.github/workflows/test.yml similarity index 91% rename from .github/workflows/maven.yml rename to .github/workflows/test.yml index bd9632e0c..a1b79e15f 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,16 @@ # 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: Java CI with Maven +name: Test with Maven + +on: + push: + branches-ignore: + - production + pull_request: + branches-ignore: + - production -on: [push, pull_request] jobs: build: diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2bf8942dd..7edfdd97d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -11,7 +11,7 @@ maven-dev: - 'development' - 'milestone-*' script: - - 'mvn versions:set -DnewVersion=21.12.1-SNAPSHOT' + - 'mvn versions:set -DnewVersion=22.3-SNAPSHOT' - 'mvn versions:update-child-modules' - 'mvn -DgitVer=git-$CI_COMMIT_SHORT_SHA- clean deploy -s ci_settings.xml' artifacts: @@ -31,7 +31,7 @@ maven-job2: - 'master' - 'milestone-*' script: - - 'mvn versions:set -DnewVersion=21.12.1' + - 'mvn versions:set -DnewVersion=22.3' - 'mvn versions:update-child-modules' - 'mvn -DgitVer=git-$CI_COMMIT_SHORT_SHA- clean install -s ci_settings.xml' artifacts: @@ -45,7 +45,7 @@ maven-rel: only: - 'master' script: - - 'mvn versions:set -DnewVersion=21.12.1' + - 'mvn versions:set -DnewVersion=22.3' - 'mvn versions:update-child-modules' - 'mvn -DgitVer='''' clean deploy -s ci_settings.xml' artifacts: diff --git a/bedwars-api/pom.xml b/bedwars-api/pom.xml index 0a916a4ec..7a7646092 100644 --- a/bedwars-api/pom.xml +++ b/bedwars-api/pom.xml @@ -5,7 +5,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT 4.0.0 bedwars-api @@ -45,6 +45,12 @@ false + + maven-javadoc-plugin + + false + + \ No newline at end of file diff --git a/bedwars-plugin/pom.xml b/bedwars-plugin/pom.xml index e62fa0e93..2d49f8cb2 100644 --- a/bedwars-plugin/pom.xml +++ b/bedwars-plugin/pom.xml @@ -5,7 +5,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT 4.0.0 bedwars-plugin diff --git a/ci_settings.xml b/ci_settings.xml index 2d5ae189c..9485f883c 100644 --- a/ci_settings.xml +++ b/ci_settings.xml @@ -13,8 +13,8 @@ ftp-repo - ${env.FTP_USR} - ${env.FTP_PASS} + ${env.MVN_REPO_USER} + ${env.MVN_REPO_PASS} @@ -26,4 +26,5 @@ + \ No newline at end of file diff --git a/pom.xml b/pom.xml index 11506aa37..b1dc09d4e 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ com.andrei1058.bedwars BedWars1058 pom - 22.2 + 22.3-SNAPSHOT UTF-8 diff --git a/resetadapter_slime/pom.xml b/resetadapter_slime/pom.xml index 486b68bdf..f528a8ba9 100644 --- a/resetadapter_slime/pom.xml +++ b/resetadapter_slime/pom.xml @@ -7,7 +7,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT resetadapter-slime diff --git a/versionsupport_1_10_R1/pom.xml b/versionsupport_1_10_R1/pom.xml index b89e0317c..88b298c1d 100644 --- a/versionsupport_1_10_R1/pom.xml +++ b/versionsupport_1_10_R1/pom.xml @@ -7,7 +7,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT versionsupport_1_10_R1 diff --git a/versionsupport_1_11_R1/pom.xml b/versionsupport_1_11_R1/pom.xml index 203a68616..41fbb516a 100644 --- a/versionsupport_1_11_R1/pom.xml +++ b/versionsupport_1_11_R1/pom.xml @@ -11,7 +11,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT diff --git a/versionsupport_1_12_R1/pom.xml b/versionsupport_1_12_R1/pom.xml index ad8cc0411..2c9f2201d 100644 --- a/versionsupport_1_12_R1/pom.xml +++ b/versionsupport_1_12_R1/pom.xml @@ -10,7 +10,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT diff --git a/versionsupport_1_13_R2/pom.xml b/versionsupport_1_13_R2/pom.xml index 3ed71bc42..a26eb0d9a 100644 --- a/versionsupport_1_13_R2/pom.xml +++ b/versionsupport_1_13_R2/pom.xml @@ -10,7 +10,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT diff --git a/versionsupport_1_14_R1/pom.xml b/versionsupport_1_14_R1/pom.xml index bfeed414a..5cf9cee00 100644 --- a/versionsupport_1_14_R1/pom.xml +++ b/versionsupport_1_14_R1/pom.xml @@ -10,7 +10,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT diff --git a/versionsupport_1_15_R1/pom.xml b/versionsupport_1_15_R1/pom.xml index 6ade10bb3..72cb6963b 100644 --- a/versionsupport_1_15_R1/pom.xml +++ b/versionsupport_1_15_R1/pom.xml @@ -5,7 +5,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT 4.0.0 diff --git a/versionsupport_1_16_R1/pom.xml b/versionsupport_1_16_R1/pom.xml index 86764c246..ec3379dce 100644 --- a/versionsupport_1_16_R1/pom.xml +++ b/versionsupport_1_16_R1/pom.xml @@ -5,7 +5,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT 4.0.0 diff --git a/versionsupport_1_16_R2/pom.xml b/versionsupport_1_16_R2/pom.xml index 21cac3b0f..83c52e500 100644 --- a/versionsupport_1_16_R2/pom.xml +++ b/versionsupport_1_16_R2/pom.xml @@ -5,7 +5,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT 4.0.0 diff --git a/versionsupport_1_8_R3/pom.xml b/versionsupport_1_8_R3/pom.xml index ef412eb86..14dced214 100644 --- a/versionsupport_1_8_R3/pom.xml +++ b/versionsupport_1_8_R3/pom.xml @@ -7,7 +7,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT versionsupport_1_8_R3 diff --git a/versionsupport_1_9_R2/pom.xml b/versionsupport_1_9_R2/pom.xml index c1d89d794..e5e28626e 100644 --- a/versionsupport_1_9_R2/pom.xml +++ b/versionsupport_1_9_R2/pom.xml @@ -7,7 +7,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT versionsupport_1_9_R2 diff --git a/versionsupport_common/pom.xml b/versionsupport_common/pom.xml index d36798771..6a512c66d 100644 --- a/versionsupport_common/pom.xml +++ b/versionsupport_common/pom.xml @@ -5,7 +5,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT 4.0.0 diff --git a/versionsupport_v1_16_R3/pom.xml b/versionsupport_v1_16_R3/pom.xml index 729138e15..874063c66 100644 --- a/versionsupport_v1_16_R3/pom.xml +++ b/versionsupport_v1_16_R3/pom.xml @@ -5,7 +5,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT 4.0.0 diff --git a/versionsupport_v1_17_R1/pom.xml b/versionsupport_v1_17_R1/pom.xml index 105eb3a27..bc1184a27 100644 --- a/versionsupport_v1_17_R1/pom.xml +++ b/versionsupport_v1_17_R1/pom.xml @@ -5,7 +5,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT 4.0.0 diff --git a/versionsupport_v1_18_R1/pom.xml b/versionsupport_v1_18_R1/pom.xml index 7da6f0f4d..ed3124215 100644 --- a/versionsupport_v1_18_R1/pom.xml +++ b/versionsupport_v1_18_R1/pom.xml @@ -5,7 +5,7 @@ BedWars1058 com.andrei1058.bedwars - 22.2 + 22.3-SNAPSHOT 4.0.0