diff --git a/.github/workflows/delete_old_s3_objects.yml b/.github/workflows/delete_old_s3_objects.yml index 14bf06121..10af89b5a 100644 --- a/.github/workflows/delete_old_s3_objects.yml +++ b/.github/workflows/delete_old_s3_objects.yml @@ -2,6 +2,11 @@ name: Empty S3 directory on: workflow_call: + inputs: + path_to_delete: + description: 'The path will be deleted' + required: true + type: string secrets: S3_ACCESS_KEY: required: true @@ -25,4 +30,4 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY }} AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_KEY }} AWS_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} - PATH_TO_DELETE: updates/latest + PATH_TO_DELETE: ${{ inputs.path_to_delete }} diff --git a/.github/workflows/jvm-ci.yml b/.github/workflows/jvm-ci.yml index 770fc5576..b3bf88b4c 100644 --- a/.github/workflows/jvm-ci.yml +++ b/.github/workflows/jvm-ci.yml @@ -30,6 +30,29 @@ jobs: Build_PKG: needs: CI uses: ./.github/workflows/build_pkg.yml + Empty_Old_S3_Files: + needs: [ Build_Executable, Build_Installers ] + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' + uses: ./.github/workflows/delete_old_s3_objects.yml + secrets: inherit + with: + path_to_delete: 'updates/snapshot' + Upload_Updates_To_S3: + needs: [ Build_Executable, Build_Installers, Empty_Old_S3_Files ] + if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/dev' + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + name: installer-dist + path: target/media + - uses: ./.github/workflows/upload_to_cloudflare_s3.yml + with: + destination_dir: 'updates/snapshot' + Clear_CloudFlare_Updates: + needs: [ Upload_Updates_To_S3 ] + uses: ./.github/workflows/flush_cloudflare_cache.yml + secrets: inherit Build_Docker: needs: CI runs-on: ubuntu-latest diff --git a/.github/workflows/jvm-release.yml b/.github/workflows/jvm-release.yml index 5475c336a..8271b3700 100644 --- a/.github/workflows/jvm-release.yml +++ b/.github/workflows/jvm-release.yml @@ -45,24 +45,21 @@ jobs: needs: Build_Executable uses: ./.github/workflows/build_portable.yml Empty_Old_S3_Files: - needs: [Build_Executable, Build_Installers, Build_SPK, Build_DEB, Build_PKG, Build_Portable] + needs: [ Build_Executable, Build_Installers ] uses: ./.github/workflows/delete_old_s3_objects.yml secrets: inherit + with: + path_to_delete: 'updates/latest' Upload_Updates_To_S3: - needs: [Build_Executable, Build_Installers, Build_SPK, Build_DEB, Build_PKG, Build_Portable, Empty_Old_S3_Files] + needs: [ Build_Executable, Build_Installers, Empty_Old_S3_Files ] runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v4 with: name: installer-dist path: target/media - - uses: shallwefootball/s3-upload-action@master + - uses: ./.github/workflows/upload_to_cloudflare_s3.yml with: - aws_key_id: ${{ secrets.S3_ACCESS_KEY }} - aws_secret_access_key: ${{ secrets.S3_SECRET_KEY }} - aws_bucket: ${{ secrets.S3_BUCKET }} - endpoint: ${{ secrets.S3_ENDPOINT }} - source_dir: 'target/media' destination_dir: 'updates/latest' Clear_CloudFlare_Updates: needs: [Upload_Updates_To_S3] diff --git a/.github/workflows/upload_to_cloudflare_s3.yml b/.github/workflows/upload_to_cloudflare_s3.yml new file mode 100644 index 000000000..918eabefb --- /dev/null +++ b/.github/workflows/upload_to_cloudflare_s3.yml @@ -0,0 +1,32 @@ +name: Upload to CloudFlare S3 + +on: + workflow_call: + inputs: + destination_dir: + description: 'The destination directory' + required: true + type: string + secrets: + S3_ACCESS_KEY: + required: true + S3_SECRET_KEY: + required: true + S3_ENDPOINT: + required: true + S3_BUCKET: + required: true +jobs: + Upload_To_CloudFlare_S3: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Remove from S3 + uses: shallwefootball/s3-upload-action@master + with: + aws_key_id: ${{ secrets.S3_ACCESS_KEY }} + aws_secret_access_key: ${{ secrets.S3_SECRET_KEY }} + aws_bucket: ${{ secrets.S3_BUCKET }} + endpoint: ${{ secrets.S3_ENDPOINT }} + source_dir: 'target/media' + destination_dir: ${{ inputs.destination_dir }} diff --git a/install4j/project.install4j b/install4j/project.install4j index a7c285a76..2cb107386 100644 --- a/install4j/project.install4j +++ b/install4j/project.install4j @@ -12,6 +12,8 @@ + + @@ -104,7 +106,7 @@ - + diff --git a/pom.xml b/pom.xml index 8770bc493..126e91e77 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.ghostchu.peerbanhelper peerbanhelper - 7.2.0-Alpha1 + 7.2.0-SNAPSHOT-24w49a jar PeerBanHelper @@ -180,6 +180,39 @@ ${project.basedir}/target/libraries ${project.basedir}/target/PeerBanHelper.jar + https://pbh-files.pbh-btn.com/updates/snapshot/updates.xml + + + + + + + + + + + install4j-release + + + + com.install4j + install4j-maven + 11.0.1 + + + compile-installers + package + + compile + + + ${install4j.home} + ${project.basedir}/install4j/project.install4j + + ${project.basedir}/target/libraries + ${project.basedir}/target/PeerBanHelper.jar + https://pbh-files.pbh-btn.com/updates/latest/updates.xml +