Thanks to visit codestin.com
Credit goes to github.com

Skip to content

use total queue size when checking if player can be sent instantly #311

use total queue size when checking if player can be sent instantly

use total queue size when checking if player can be sent instantly #311

Workflow file for this run

# 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: Java CI with Gradle
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'temurin'
- name: Build with Gradle
uses: gradle/gradle-build-action@937999e9cc2425eddc7fd62d1053baf041147db7
with:
arguments: :free:shadowJar :premium:shadowJar
- name: Upload plugin jar artifact
uses: actions/[email protected]
with:
# Artifact name
name: plugin jar
# A file, directory or wildcard pattern that describes what to upload
path: free/build/libs/ajQueue*.jar
# The desired behavior if no files are found using the provided path.
if-no-files-found: error
- name: Upload build files artifact
uses: actions/[email protected]
with:
# Artifact name
name: build-files
# A file, directory or wildcard pattern that describes what to upload
path: '*/build/*'
# The desired behavior if no files are found using the provided path.
if-no-files-found: error
retention-days: 2
deploy:
runs-on: ubuntu-latest
environment: maven-repo-deploy
env:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
needs: build
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
name: build-files
- name: Deploy api with Gradle
run: './gradlew :api:publish'
- name: Deploy common with Gradle
run: './gradlew :common:publish'
updater:
runs-on: ubuntu-latest
environment: upload-to-updater
if: github.ref == 'refs/heads/master'
needs: build
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/[email protected]
with:
name: build-files
- run: |
VERSION=`cat build.gradle.kts | grep "version " | awk -F'"' '{print $2}'`
# Plus
cd premium/build/libs/
echo -n "{ \"message\": \"Plugin Update: $(echo ajQueuePlus-*.jar) (jar)\", \"content\": \"" > file_upload.json
base64 ajQueuePlus-*.jar >> file_upload.json
echo -n "\" }" >> file_upload.json
curl -X PUT -H "Authorization: Bearer $GH_TOKEN" -H "Content-Type: application/json" -d @file_upload.json "https://api.github.com/repos/ajgeiss0702/plugin-updates/contents/jars/premium/$(echo ajQueuePlus*.jar)"
SHA=`curl -H "Authorization: Bearer $GH_TOKEN" -s "https://api.github.com/repos/ajgeiss0702/plugin-updates/contents/plugins/ajQueuePlus.json" | jq -r '.sha'`
NEW_JSON="{ \"latest\": \"$VERSION\", \"premium\": true }"
curl -X PUT -H "Authorization: Bearer $GH_TOKEN" -H "Content-Type: application/json" -d "{ \"message\": \"Plugin Update: $(echo ajQueuePlus-*.jar) (json)\", \"content\": \"$(echo $NEW_JSON | base64)\", \"sha\": \"$SHA\" }" "https://api.github.com/repos/ajgeiss0702/plugin-updates/contents/plugins/ajQueuePlus.json"
# Free
cd ../../../free/build/libs/
echo -n "{ \"message\": \"Plugin Update: $(echo ajQueue-*.jar) (jar)\", \"content\": \"" > file_upload.json
base64 ajQueue-*.jar >> file_upload.json
echo -n "\" }" >> file_upload.json
curl -X PUT -H "Authorization: Bearer $GH_TOKEN" -H "Content-Type: application/json" -d @file_upload.json "https://api.github.com/repos/ajgeiss0702/plugin-updates/contents/jars/free/$(echo ajQueue*.jar)"
SHA=`curl -H "Authorization: Bearer $GH_TOKEN" -s "https://api.github.com/repos/ajgeiss0702/plugin-updates/contents/plugins/ajQueue.json" | jq -r '.sha'`
NEW_JSON="{ \"latest\": \"$VERSION\", \"premium\": false }"
curl -X PUT -H "Authorization: Bearer $GH_TOKEN" -H "Content-Type: application/json" -d "{ \"message\": \"Plugin Update: $(echo ajQueue-*.jar) (json)\", \"content\": \"$(echo $NEW_JSON | base64)\", \"sha\": \"$SHA\" }" "https://api.github.com/repos/ajgeiss0702/plugin-updates/contents/plugins/ajQueue.json"