mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-23 21:12:34 +01:00
Merge Scheme into Update.yml
This commit is contained in:
78
.github/workflows/Scheme.yml
vendored
78
.github/workflows/Scheme.yml
vendored
@@ -1,78 +0,0 @@
|
|||||||
name: Scheme
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
Scheme:
|
|
||||||
name: Scheme
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Clone repo
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- uses: actions/setup-java@v3
|
|
||||||
with:
|
|
||||||
distribution: 'temurin'
|
|
||||||
java-version: '17'
|
|
||||||
architecture: x64
|
|
||||||
|
|
||||||
- uses: dorny/paths-filter@v3
|
|
||||||
id: changes
|
|
||||||
with:
|
|
||||||
filters: |
|
|
||||||
config:
|
|
||||||
- 'buildSrc/src/main/kotlin/Config.kt'
|
|
||||||
|
|
||||||
- name: Set up gradle
|
|
||||||
if: steps.changes.outputs.config == 'true'
|
|
||||||
uses: gradle/actions/setup-gradle@v3
|
|
||||||
|
|
||||||
- name: Build Suwayomi-Server
|
|
||||||
if: steps.changes.outputs.config == 'true'
|
|
||||||
run: ./gradlew desktop:setupTachideskJar
|
|
||||||
|
|
||||||
- name: Run Suwayomi-Server
|
|
||||||
if: steps.changes.outputs.config == 'true'
|
|
||||||
run: |
|
|
||||||
# Run the JAR file
|
|
||||||
java -jar desktop/src/main/resources/Tachidesk.jar > output.log &
|
|
||||||
|
|
||||||
# Capture the PID of the Java process
|
|
||||||
pid=$!
|
|
||||||
|
|
||||||
# Wait for 'Javalin started' message
|
|
||||||
while true; do
|
|
||||||
if grep -q "Javalin started" <(tail -n 5 output.log); then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
sleep 1
|
|
||||||
done
|
|
||||||
|
|
||||||
# Query the GraphQL endpoint and save the result to a file
|
|
||||||
./gradlew :data:graphql:downloadApolloSchema --endpoint='http://localhost:4567/api/graphql' --schema=data/graphql/src/commonMain/graphql/schema.graphqls
|
|
||||||
|
|
||||||
# Kill the Java process
|
|
||||||
kill $pid
|
|
||||||
rm output.log
|
|
||||||
|
|
||||||
- name: Commit library changes
|
|
||||||
if: steps.changes.outputs.config == 'true'
|
|
||||||
uses: EndBug/add-and-commit@v9
|
|
||||||
with:
|
|
||||||
message: Update Scheme
|
|
||||||
push: false
|
|
||||||
|
|
||||||
- name: Push changes
|
|
||||||
if: steps.changes.outputs.config == 'true'
|
|
||||||
uses: ad-m/github-push-action@master
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
branch: ${{ github.ref }}
|
|
||||||
72
.github/workflows/Update.yml
vendored
72
.github/workflows/Update.yml
vendored
@@ -23,26 +23,42 @@ jobs:
|
|||||||
java-version: '17'
|
java-version: '17'
|
||||||
architecture: x64
|
architecture: x64
|
||||||
|
|
||||||
|
- name: Set up gradle
|
||||||
|
uses: gradle/actions/setup-gradle@v3
|
||||||
|
|
||||||
- name: Setup Cl
|
- name: Setup Cl
|
||||||
run: ./scripts/SetupClUnix.sh
|
run: ./scripts/SetupClUnix.sh
|
||||||
|
|
||||||
- name: Update Locales
|
- uses: dorny/paths-filter@v3
|
||||||
uses: gradle/gradle-build-action@v2
|
id: changes
|
||||||
with:
|
with:
|
||||||
arguments: generateLocales
|
filters: |
|
||||||
|
config:
|
||||||
|
- 'buildSrc/src/main/kotlin/Config.kt'
|
||||||
|
locales:
|
||||||
|
- 'i18n/**'
|
||||||
|
versions:
|
||||||
|
- 'gradle/libs.versions.toml'
|
||||||
|
kt:
|
||||||
|
- '**.kt'
|
||||||
|
|
||||||
|
- name: Update Locales
|
||||||
|
if: steps.changes.outputs.locales == 'true'
|
||||||
|
run: ./gradlew generateLocales
|
||||||
|
|
||||||
- name: Commit locale changes
|
- name: Commit locale changes
|
||||||
|
if: steps.changes.outputs.locales == 'true'
|
||||||
uses: EndBug/add-and-commit@v9
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
message: Update avalible Locales
|
message: Update available Locales
|
||||||
push: false
|
push: false
|
||||||
|
|
||||||
- name: Update Libraries
|
- name: Update Libraries
|
||||||
uses: gradle/gradle-build-action@v2
|
if: steps.changes.outputs.versions == 'true'
|
||||||
with:
|
run: ./gradlew desktop:exportLibraryDefinitions -PexportPath=build
|
||||||
arguments: desktop:exportLibraryDefinitions -PexportPath=build
|
|
||||||
|
|
||||||
- name: Move libraries json
|
- name: Move libraries json
|
||||||
|
if: steps.changes.outputs.versions == 'true'
|
||||||
run: |
|
run: |
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
jq 'del(.metadata)' --sort-keys desktop/build/aboutlibraries.json > build/json1.json
|
jq 'del(.metadata)' --sort-keys desktop/build/aboutlibraries.json > build/json1.json
|
||||||
@@ -55,22 +71,58 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Commit library changes
|
- name: Commit library changes
|
||||||
|
if: steps.changes.outputs.versions == 'true'
|
||||||
uses: EndBug/add-and-commit@v9
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
message: Update Libraries
|
message: Update Libraries
|
||||||
push: false
|
push: false
|
||||||
|
|
||||||
- name: Format files
|
- name: Format files
|
||||||
uses: gradle/gradle-build-action@v2
|
if: steps.changes.outputs.kt == 'true'
|
||||||
with:
|
run: ./gradlew formatKotlin
|
||||||
arguments: formatKotlin
|
|
||||||
|
|
||||||
- name: Commit lint changes
|
- name: Commit lint changes
|
||||||
|
if: steps.changes.outputs.kt == 'true'
|
||||||
uses: EndBug/add-and-commit@v9
|
uses: EndBug/add-and-commit@v9
|
||||||
with:
|
with:
|
||||||
message: Automatic Lint
|
message: Automatic Lint
|
||||||
push: false
|
push: false
|
||||||
|
|
||||||
|
- name: Build Suwayomi-Server
|
||||||
|
if: steps.changes.outputs.config == 'true'
|
||||||
|
run: ./gradlew desktop:setupTachideskJar
|
||||||
|
|
||||||
|
- name: Run Suwayomi-Server
|
||||||
|
if: steps.changes.outputs.config == 'true'
|
||||||
|
run: |
|
||||||
|
# Run the JAR file
|
||||||
|
java -jar desktop/src/main/resources/Tachidesk.jar > output.log &
|
||||||
|
|
||||||
|
# Capture the PID of the Java process
|
||||||
|
pid=$!
|
||||||
|
|
||||||
|
# Wait for 'Javalin started' message
|
||||||
|
while true; do
|
||||||
|
if grep -q "Javalin started" <(tail -n 5 output.log); then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
sleep 1
|
||||||
|
done
|
||||||
|
|
||||||
|
# Query the GraphQL endpoint and save the result to a file
|
||||||
|
./gradlew :data:graphql:downloadApolloSchema --endpoint='http://localhost:4567/api/graphql' --schema=data/graphql/src/commonMain/graphql/schema.graphqls
|
||||||
|
|
||||||
|
# Kill the Java process
|
||||||
|
kill $pid
|
||||||
|
rm output.log
|
||||||
|
|
||||||
|
- name: Commit library changes
|
||||||
|
if: steps.changes.outputs.config == 'true'
|
||||||
|
uses: EndBug/add-and-commit@v9
|
||||||
|
with:
|
||||||
|
message: Update Scheme
|
||||||
|
push: false
|
||||||
|
|
||||||
- name: Push changes
|
- name: Push changes
|
||||||
uses: ad-m/github-push-action@master
|
uses: ad-m/github-push-action@master
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user