From 8f34ebbca4ee2a7adf1a9ebebadd24fd83159d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Mon, 18 Mar 2024 18:12:55 -0500 Subject: [PATCH] feat: grouped ratings workflows --- .github/workflows/cd-ratings-asia.yml | 6 +--- .github/workflows/cd-ratings-eu.yml | 6 +--- .github/workflows/cd-ratings-latest.yml | 43 +++++++++++++++++++++++++ .github/workflows/cd-ratings-na.yml | 6 +--- package.json | 2 +- 5 files changed, 47 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/cd-ratings-latest.yml diff --git a/.github/workflows/cd-ratings-asia.yml b/.github/workflows/cd-ratings-asia.yml index 55d4c950e..a4bb34d20 100644 --- a/.github/workflows/cd-ratings-asia.yml +++ b/.github/workflows/cd-ratings-asia.yml @@ -1,11 +1,7 @@ name: CD Ratings Asia -# latest: '0 0 * * *' -# asia midnight: '0 17 * * *' - on: schedule: - - cron: '0 0 * * *' - cron: '0 17 * * *' jobs: @@ -35,4 +31,4 @@ jobs: run: yarn - name: Generate leaderboard - run: GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DISCORD_BLITZ_DB=${{ secrets.DISCORD_BLITZ_DB }} yarn publish:ratingsleaderboard --region=asia --target=${{ github.event.schedule == '0 0 * * *' && 'latest' || 'midnight' }} + run: GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DISCORD_BLITZ_DB=${{ secrets.DISCORD_BLITZ_DB }} yarn publish:ratingsleaderboard --region=asia --target=midnight diff --git a/.github/workflows/cd-ratings-eu.yml b/.github/workflows/cd-ratings-eu.yml index 128638e85..66f331e95 100644 --- a/.github/workflows/cd-ratings-eu.yml +++ b/.github/workflows/cd-ratings-eu.yml @@ -1,11 +1,7 @@ name: CD Ratings Europe -# latest: '0 0 * * *' -# eu midnight: '0 23 * * *' - on: schedule: - - cron: '0 0 * * *' - cron: '0 23 * * *' jobs: @@ -35,4 +31,4 @@ jobs: run: yarn - name: Generate leaderboard - run: GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DISCORD_BLITZ_DB=${{ secrets.DISCORD_BLITZ_DB }} yarn publish:ratingsleaderboard --region=eu --target=${{ github.event.schedule == '0 0 * * *' && 'latest' || 'midnight' }} + run: GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DISCORD_BLITZ_DB=${{ secrets.DISCORD_BLITZ_DB }} yarn publish:ratingsleaderboard --region=eu --target=midnight diff --git a/.github/workflows/cd-ratings-latest.yml b/.github/workflows/cd-ratings-latest.yml new file mode 100644 index 000000000..0aea10c1e --- /dev/null +++ b/.github/workflows/cd-ratings-latest.yml @@ -0,0 +1,43 @@ +name: CD Ratings North America + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + host: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Use node + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: 'npm' + + - name: Install Yarn + run: npm install --location=global yarn + + - name: Use node_modules cache + uses: actions/cache@v3 + with: + path: '**/node_modules' + key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + + - name: Install dependencies + run: yarn + + - name: Generate NA leaderboard + run: GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DISCORD_BLITZ_DB=${{ secrets.DISCORD_BLITZ_DB }} yarn publish:ratingsleaderboard --region=na --target=latest + if: always() + + - name: Generate EU leaderboard + run: GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DISCORD_BLITZ_DB=${{ secrets.DISCORD_BLITZ_DB }} yarn publish:ratingsleaderboard --region=eu --target=latest + if: always() + + - name: Generate Asia leaderboard + run: GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DISCORD_BLITZ_DB=${{ secrets.DISCORD_BLITZ_DB }} yarn publish:ratingsleaderboard --region=asia --target=latest + if: always() diff --git a/.github/workflows/cd-ratings-na.yml b/.github/workflows/cd-ratings-na.yml index 146202678..65156fae8 100644 --- a/.github/workflows/cd-ratings-na.yml +++ b/.github/workflows/cd-ratings-na.yml @@ -1,11 +1,7 @@ name: CD Ratings North America -# latest: '0 0 * * *' -# na midnight: '0 5 * * *' - on: schedule: - - cron: '0 0 * * *' - cron: '0 5 * * *' jobs: @@ -35,4 +31,4 @@ jobs: run: yarn - name: Generate leaderboard - run: GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DISCORD_BLITZ_DB=${{ secrets.DISCORD_BLITZ_DB }} yarn publish:ratingsleaderboard --region=na --target=${{ github.event.schedule == '0 0 * * *' && 'latest' || 'midnight' }} + run: GH_TOKEN=${{ secrets.GH_TOKEN }} DISCORD_TOKEN=${{ secrets.DISCORD_TOKEN }} DISCORD_BLITZ_DB=${{ secrets.DISCORD_BLITZ_DB }} yarn publish:ratingsleaderboard --region=na --target=midnight diff --git a/package.json b/package.json index ecad8f8e5..27dc9d625 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "blitzkrieg", - "version": "1.17.1", + "version": "1.18.0", "description": "🎉 Tools for everything World of Tanks Blitz", "main": "src/server.ts", "type": "module",