From 70e304b27fedc99b3125383f69ea95dd3a73aa9c Mon Sep 17 00:00:00 2001 From: Paul Schifferer Date: Thu, 18 Jan 2024 18:08:22 -0800 Subject: [PATCH] Updated workflows --- .github/workflows/ci-build-1.18.yml | 66 ------------------- .github/workflows/ci-build-1.19.yml | 66 ------------------- .github/workflows/ci-build-1.20.yml | 66 ------------------- .../{ci-build-1.16.yml => ci-build.yml} | 16 ++--- .github/workflows/debug.yml | 66 +++++++++++++++++++ .github/workflows/pr-build-1.16-release.yml | 35 ---------- .github/workflows/pr-build-1.18-release.yml | 35 ---------- .github/workflows/pr-build-1.19-release.yml | 35 ---------- .github/workflows/pr-build-1.19.yml | 35 ---------- .github/workflows/pr-build-1.20-release.yml | 35 ---------- .github/workflows/pr-build-1.20.yml | 35 ---------- ...pr-build-1.16.yml => pr-build-release.yml} | 8 ++- .../{pr-build-1.18.yml => pr-build.yml} | 6 +- .github/workflows/release-1.18.yml | 64 ------------------ .github/workflows/release-1.19.yml | 64 ------------------ .github/workflows/release-1.20.yml | 64 ------------------ .../{release-1.16.yml => release.yml} | 35 +++++----- 17 files changed, 101 insertions(+), 630 deletions(-) delete mode 100644 .github/workflows/ci-build-1.18.yml delete mode 100644 .github/workflows/ci-build-1.19.yml delete mode 100644 .github/workflows/ci-build-1.20.yml rename .github/workflows/{ci-build-1.16.yml => ci-build.yml} (79%) create mode 100644 .github/workflows/debug.yml delete mode 100644 .github/workflows/pr-build-1.16-release.yml delete mode 100644 .github/workflows/pr-build-1.18-release.yml delete mode 100644 .github/workflows/pr-build-1.19-release.yml delete mode 100644 .github/workflows/pr-build-1.19.yml delete mode 100644 .github/workflows/pr-build-1.20-release.yml delete mode 100644 .github/workflows/pr-build-1.20.yml rename .github/workflows/{pr-build-1.16.yml => pr-build-release.yml} (82%) rename .github/workflows/{pr-build-1.18.yml => pr-build.yml} (89%) delete mode 100644 .github/workflows/release-1.18.yml delete mode 100644 .github/workflows/release-1.19.yml delete mode 100644 .github/workflows/release-1.20.yml rename .github/workflows/{release-1.16.yml => release.yml} (56%) diff --git a/.github/workflows/ci-build-1.18.yml b/.github/workflows/ci-build-1.18.yml deleted file mode 100644 index 65c85714..00000000 --- a/.github/workflows/ci-build-1.18.yml +++ /dev/null @@ -1,66 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: CI (1.18) - -on: - push: - branches: [ 1.18 ] - paths: - - 'src/**' - - 'test/**' - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - - id: get_last_version - name: Get last version - run: | - echo "latest_version=$(cat .release-info/1.18/VERSION)" >> $GITHUB_ENV - - id: bump_version - name: Bump version - uses: cbrgm/semver-bump-action@main - with: - current-version: ${{ env.latest_version }} - bump-level: patch - - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 - with: - arguments: build test - env: - CATHERDER_VERSION: "${{ steps.bump_version.outputs.new_version }}" - - name: Commit version file - run: | - git config --global user.email "ci@sweetrpg.com" - git config --global user.name "SweetRPG CI" - echo "${{ steps.bump_version.outputs.new_version }}" > .release-info/1.18/VERSION - git add .release-info/1.18/VERSION - git commit -m "Update 1.18 VERSION file" - git push origin - - name: Release artifacts - uses: softprops/action-gh-release@v1 - with: - tag_name: "1.18-${{ steps.bump_version.outputs.new_version }}" - prerelease: false - files: | - build/libs/*.jar diff --git a/.github/workflows/ci-build-1.19.yml b/.github/workflows/ci-build-1.19.yml deleted file mode 100644 index 26a3c1b1..00000000 --- a/.github/workflows/ci-build-1.19.yml +++ /dev/null @@ -1,66 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: CI (1.19) - -on: - push: - branches: [ 1.19 ] - paths: - - 'src/**' - - 'test/**' - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - - id: get_last_version - name: Get last version - run: | - echo "latest_version=$(cat .release-info/1.19/VERSION)" >> $GITHUB_ENV - - id: bump_version - name: Bump version - uses: cbrgm/semver-bump-action@main - with: - current-version: ${{ env.latest_version }} - bump-level: patch - - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 - with: - arguments: build test - env: - CATHERDER_VERSION: "${{ steps.bump_version.outputs.new_version }}" - - name: Commit version file - run: | - git config --global user.email "ci@sweetrpg.com" - git config --global user.name "SweetRPG CI" - echo "${{ steps.bump_version.outputs.new_version }}" > .release-info/1.19/VERSION - git add .release-info/1.19/VERSION - git commit -m "Update 1.19 VERSION file" - git push origin - - name: Release artifacts - uses: softprops/action-gh-release@v1 - with: - tag_name: "1.19-${{ steps.bump_version.outputs.new_version }}" - prerelease: true - files: | - build/libs/*.jar diff --git a/.github/workflows/ci-build-1.20.yml b/.github/workflows/ci-build-1.20.yml deleted file mode 100644 index fb37a614..00000000 --- a/.github/workflows/ci-build-1.20.yml +++ /dev/null @@ -1,66 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: CI (1.20) - -on: - push: - branches: [ 1.20 ] - paths: - - 'src/**' - - 'test/**' - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - build: - - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - - id: get_last_version - name: Get last version - run: | - echo "latest_version=$(cat .release-info/1.20/VERSION)" >> $GITHUB_ENV - - id: bump_version - name: Bump version - uses: cbrgm/semver-bump-action@main - with: - current-version: ${{ env.latest_version }} - bump-level: patch - - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 - with: - arguments: build test - env: - CATHERDER_VERSION: "${{ steps.bump_version.outputs.new_version }}" - - name: Commit version file - run: | - git config --global user.email "ci@sweetrpg.com" - git config --global user.name "SweetRPG CI" - echo "${{ steps.bump_version.outputs.new_version }}" > .release-info/1.20/VERSION - git add .release-info/1.20/VERSION - git commit -m "Update 1.20 VERSION file" - git push origin - - name: Release artifacts - uses: softprops/action-gh-release@v1 - with: - tag_name: "1.20-${{ steps.bump_version.outputs.new_version }}" - prerelease: true - files: | - build/libs/*.jar diff --git a/.github/workflows/ci-build-1.16.yml b/.github/workflows/ci-build.yml similarity index 79% rename from .github/workflows/ci-build-1.16.yml rename to .github/workflows/ci-build.yml index c43e1ac7..133e14d9 100644 --- a/.github/workflows/ci-build-1.16.yml +++ b/.github/workflows/ci-build.yml @@ -5,11 +5,11 @@ # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle -name: CI (1.16) +name: CI on: push: - branches: [ 1.16 ] + branches: [ "1.16", "1.18", "1.19", "1.20" ] paths: - 'src/**' - 'test/**' @@ -36,7 +36,7 @@ jobs: - id: get_last_version name: Get last version run: | - echo "latest_version=$(cat .release-info/1.16/VERSION)" >> $GITHUB_ENV + echo "latest_version=$(cat .release-info/${{ github.ref_name }}/VERSION)" >> $GITHUB_ENV - id: bump_version name: Bump version uses: cbrgm/semver-bump-action@main @@ -46,21 +46,21 @@ jobs: - name: Build with Gradle uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 with: - arguments: build test + arguments: build test --scan env: CATHERDER_VERSION: "${{ steps.bump_version.outputs.new_version }}" - name: Commit version file run: | git config --global user.email "ci@sweetrpg.com" git config --global user.name "SweetRPG CI" - echo "${{ steps.bump_version.outputs.new_version }}" > .release-info/1.16/VERSION - git add .release-info/1.16/VERSION - git commit -m "Update 1.16 VERSION file" + echo "${{ steps.bump_version.outputs.new_version }}" > .release-info/${{ github.ref_name }}/VERSION + git add .release-info/${{ github.ref_name }}/VERSION + git commit -m "Update ${{ github.ref_name }} VERSION file" git push origin - name: Release artifacts uses: softprops/action-gh-release@v1 with: - tag_name: "1.16-${{ steps.bump_version.outputs.new_version }}" + tag_name: "${{ github.ref_name }}-${{ steps.bump_version.outputs.new_version }}" prerelease: true files: | build/libs/*.jar diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml new file mode 100644 index 00000000..bba81329 --- /dev/null +++ b/.github/workflows/debug.yml @@ -0,0 +1,66 @@ +name: Debug + +on: + create: + tags: + - '*' + release: + types: + - published + - created + push: + branches: + - '*' + +jobs: + debug: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Dump GitHub context + env: + GITHUB_CONTEXT: ${{ toJson(github) }} + run: echo "$GITHUB_CONTEXT" + - name: Dump job context + env: + JOB_CONTEXT: ${{ toJson(job) }} + run: echo "$JOB_CONTEXT" + - name: Dump steps context + env: + STEPS_CONTEXT: ${{ toJson(steps) }} + run: echo "$STEPS_CONTEXT" + - name: Dump runner context + env: + RUNNER_CONTEXT: ${{ toJson(runner) }} + run: echo "$RUNNER_CONTEXT" + - name: Dump strategy context + env: + STRATEGY_CONTEXT: ${{ toJson(strategy) }} + run: echo "$STRATEGY_CONTEXT" + - name: Dump matrix context + env: + MATRIX_CONTEXT: ${{ toJson(matrix) }} + run: echo "$MATRIX_CONTEXT" + - name: 'Get Previous tag' + id: previoustag + uses: actions-ecosystem/action-get-latest-tag@v1 + with: + semver_only: true + initial_version: v0.0.0 + with_initial_version: true + - name: Docker meta + id: meta + uses: docker/metadata-action@v3 + with: + images: | + registry.sweetrpg.com/sweetrpg-main-web + tags: | + type=raw,value=latest + type=raw,value=${{ steps.previoustag.outputs.tag }} + type=ref,event=branch + type=ref,event=tag + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha diff --git a/.github/workflows/pr-build-1.16-release.yml b/.github/workflows/pr-build-1.16-release.yml deleted file mode 100644 index c9a5ae61..00000000 --- a/.github/workflows/pr-build-1.16-release.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: PR (1.16 Release) - -on: - pull_request: - branches: [ 1.16-release ] - paths: - - 'src/**' - - 'test/**' - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 - with: - arguments: build test diff --git a/.github/workflows/pr-build-1.18-release.yml b/.github/workflows/pr-build-1.18-release.yml deleted file mode 100644 index 3c4b7493..00000000 --- a/.github/workflows/pr-build-1.18-release.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: PR (1.18 Release) - -on: - pull_request: - branches: [ 1.18-release ] - paths: - - 'src/**' - - 'test/**' - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 - with: - arguments: build test diff --git a/.github/workflows/pr-build-1.19-release.yml b/.github/workflows/pr-build-1.19-release.yml deleted file mode 100644 index 1d86c637..00000000 --- a/.github/workflows/pr-build-1.19-release.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: PR (1.19 Release) - -on: - pull_request: - branches: [ 1.19-release ] - paths: - - 'src/**' - - 'test/**' - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 - with: - arguments: build test diff --git a/.github/workflows/pr-build-1.19.yml b/.github/workflows/pr-build-1.19.yml deleted file mode 100644 index e3c039f6..00000000 --- a/.github/workflows/pr-build-1.19.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: PR (1.19) - -on: - pull_request: - branches: [ 1.19 ] - paths: - - 'src/**' - - 'test/**' - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 - with: - arguments: build test diff --git a/.github/workflows/pr-build-1.20-release.yml b/.github/workflows/pr-build-1.20-release.yml deleted file mode 100644 index 4d778596..00000000 --- a/.github/workflows/pr-build-1.20-release.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: PR (1.20 Release) - -on: - pull_request: - branches: [ 1.20-release ] - paths: - - 'src/**' - - 'test/**' - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 - with: - arguments: build test diff --git a/.github/workflows/pr-build-1.20.yml b/.github/workflows/pr-build-1.20.yml deleted file mode 100644 index 86eebe4b..00000000 --- a/.github/workflows/pr-build-1.20.yml +++ /dev/null @@ -1,35 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: PR (1.20) - -on: - pull_request: - branches: [ 1.20 ] - paths: - - 'src/**' - - 'test/**' - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 - with: - arguments: build test diff --git a/.github/workflows/pr-build-1.16.yml b/.github/workflows/pr-build-release.yml similarity index 82% rename from .github/workflows/pr-build-1.16.yml rename to .github/workflows/pr-build-release.yml index c06502b7..c0ac6578 100644 --- a/.github/workflows/pr-build-1.16.yml +++ b/.github/workflows/pr-build-release.yml @@ -5,11 +5,11 @@ # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle -name: PR (1.16) +name: PR (Release) on: pull_request: - branches: [ 1.16 ] + branches: [ "1.16-release", "1.18-release", "1.19-release", "1.20-release" ] paths: - 'src/**' - 'test/**' @@ -21,6 +21,8 @@ jobs: build: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v3 @@ -32,4 +34,4 @@ jobs: - name: Build with Gradle uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 with: - arguments: build test + arguments: build test --console=verbose --scan diff --git a/.github/workflows/pr-build-1.18.yml b/.github/workflows/pr-build.yml similarity index 89% rename from .github/workflows/pr-build-1.18.yml rename to .github/workflows/pr-build.yml index 8dafe4ae..13fc936f 100644 --- a/.github/workflows/pr-build-1.18.yml +++ b/.github/workflows/pr-build.yml @@ -5,11 +5,11 @@ # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle -name: PR (1.18) +name: PR on: pull_request: - branches: [ 1.18 ] + branches: [ "1.16", "1.18", "1.19", "1.20" ] paths: - 'src/**' - 'test/**' @@ -34,4 +34,4 @@ jobs: - name: Build with Gradle uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 with: - arguments: build test + arguments: build test --console=verbose --scan diff --git a/.github/workflows/release-1.18.yml b/.github/workflows/release-1.18.yml deleted file mode 100644 index 87a5d1e6..00000000 --- a/.github/workflows/release-1.18.yml +++ /dev/null @@ -1,64 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Release (1.18) - -on: - push: - branches: [ 1.18-release ] - paths: - - 'src/**' - - 'test/**' - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - release: - - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 - env: - CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} - with: - arguments: curseforge - - name: Commit hash file and reset changelog - run: | - git config --global user.email "ci@sweetrpg.com" - git config --global user.name "SweetRPG CI" - - echo "${{ github.sha }}" > .release-info/1.18/RELEASE_HASH - git add .release-info/1.18/RELEASE_HASH - git commit -m "Update 1.18 RELEASE_HASH" - version=$(cat .release-info/1.18/VERSION) - git tag "release-${version}" - - echo "# $version" > CHANGELOG/1.18/${version}.md - echo "" >> CHANGELOG/1.18/${version}.md - cat CHANGELOG/1.18/current.md >> CHANGELOG/1.18/${version}.md - cat /dev/null > CHANGELOG/1.18/current.md - git add CHANGELOG/1.18 - git commit -m "Reset 1.18 changelog" - - git push origin --tags - - git checkout 1.18 - git merge 1.18-release - git push origin diff --git a/.github/workflows/release-1.19.yml b/.github/workflows/release-1.19.yml deleted file mode 100644 index 0aacefe5..00000000 --- a/.github/workflows/release-1.19.yml +++ /dev/null @@ -1,64 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Release (1.19) - -on: - push: - branches: [ 1.19-release ] - paths: - - 'src/**' - - 'test/**' - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - release: - - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 - env: - CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} - with: - arguments: curseforge - - name: Commit hash file and reset changelog - run: | - git config --global user.email "ci@sweetrpg.com" - git config --global user.name "SweetRPG CI" - - echo "${{ github.sha }}" > .release-info/1.19/RELEASE_HASH - git add .release-info/1.19/RELEASE_HASH - git commit -m "Update 1.19 RELEASE_HASH" - version=$(cat .release-info/1.19/VERSION) - git tag "release-${version}" - - echo "# $version" > CHANGELOG/1.19/${version}.md - echo "" >> CHANGELOG/1.19/${version}.md - cat CHANGELOG/1.19/current.md >> CHANGELOG/1.19/${version}.md - cat /dev/null > CHANGELOG/1.19/current.md - git add CHANGELOG/1.19 - git commit -m "Reset 1.19 changelog" - - git push origin --tags - - git checkout 1.19 - git merge 1.19-release - git push origin diff --git a/.github/workflows/release-1.20.yml b/.github/workflows/release-1.20.yml deleted file mode 100644 index 4dc5a8ce..00000000 --- a/.github/workflows/release-1.20.yml +++ /dev/null @@ -1,64 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. -# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle - -name: Release (1.20) - -on: - push: - branches: [ 1.20-release ] - paths: - - 'src/**' - - 'test/**' - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - release: - - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Set up JDK 17 - uses: actions/setup-java@v2 - with: - java-version: '17' - distribution: 'temurin' - - name: Build with Gradle - uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 - env: - CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} - with: - arguments: curseforge - - name: Commit hash file and reset changelog - run: | - git config --global user.email "ci@sweetrpg.com" - git config --global user.name "SweetRPG CI" - - echo "${{ github.sha }}" > .release-info/1.20/RELEASE_HASH - git add .release-info/1.20/RELEASE_HASH - git commit -m "Update 1.20 RELEASE_HASH" - version=$(cat .release-info/1.20/VERSION) - git tag "release-${version}" - - echo "# $version" > CHANGELOG/1.20/${version}.md - echo "" >> CHANGELOG/1.20/${version}.md - cat CHANGELOG/1.20/current.md >> CHANGELOG/1.20/${version}.md - cat /dev/null > CHANGELOG/1.20/current.md - git add CHANGELOG/1.20 - git commit -m "Reset 1.20 changelog" - - git push origin --tags - - git checkout 1.20 - git merge 1.20-release - git push origin diff --git a/.github/workflows/release-1.16.yml b/.github/workflows/release.yml similarity index 56% rename from .github/workflows/release-1.16.yml rename to .github/workflows/release.yml index 9a99f88d..da08612d 100644 --- a/.github/workflows/release-1.16.yml +++ b/.github/workflows/release.yml @@ -5,11 +5,11 @@ # This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle -name: Release (1.16) +name: Release on: push: - branches: [ 1.16-release ] + branches: [ "1.16-release", "1.18-release", "1.19-release", "1.20-release" ] paths: - 'src/**' - 'test/**' @@ -37,28 +37,31 @@ jobs: uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7 env: CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} + MODRINTH_API_KEY: ${{ secrets.MODRINTH_API_KEY }} with: - arguments: curseforge + arguments: curseforge modrinth --console=verbose - name: Commit hash file and reset changelog run: | git config --global user.email "ci@sweetrpg.com" git config --global user.name "SweetRPG CI" - - echo "${{ github.sha }}" > .release-info/1.16/RELEASE_HASH - git add .release-info/1.16/RELEASE_HASH - git commit -m "Update 1.16 RELEASE_HASH" - version=$(cat .release-info/1.16/VERSION) + + branch_version=$(cat ${{ github.ref_name }} | cut -f1 -d-) + + echo "${{ github.sha }}" > .release-info/${branch_version}/RELEASE_HASH + git add .release-info/${branch_version}/RELEASE_HASH + git commit -m "Update ${branch_version} RELEASE_HASH" + version=$(cat .release-info/${branch_version}/VERSION) git tag "release-${version}" - echo "# $version" > CHANGELOG/1.16/${version}.md - echo "" >> CHANGELOG/1.16/${version}.md - cat CHANGELOG/1.16/current.md >> CHANGELOG/1.16/${version}.md - cat /dev/null > CHANGELOG/1.16/current.md - git add CHANGELOG/1.16 - git commit -m "Reset 1.16 changelog" + echo "# $version" > CHANGELOG/${branch_version}/${version}.md + echo "" >> CHANGELOG/${branch_version}/${version}.md + cat CHANGELOG/${branch_version}/current.md >> CHANGELOG/${branch_version}/${version}.md + cat /dev/null > CHANGELOG/${branch_version}/current.md + git add CHANGELOG/${branch_version} + git commit -m "Reset ${branch_version} changelog" git push origin --tags - git checkout 1.16 - git merge 1.16-release + git checkout ${branch_version} + git merge ${{ github.ref_name }} git push origin