mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +00:00
Release 1.4.2 (#191)
* Updated Java version to 21 * Updated Node.js version used in build to 20 * Add Docker ARM64 image
This commit is contained in:
@@ -22,7 +22,7 @@ jobs:
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '18'
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Cache SonarCloud packages
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
name: Gameyfin Docker Build & Push
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
branch:
|
||||
description: "The branch to checkout when cutting the release."
|
||||
required: true
|
||||
default: "main"
|
||||
tag:
|
||||
description: "Docker image tag."
|
||||
required: true
|
||||
default: "X.Y.Z"
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
name: Release
|
||||
steps:
|
||||
- name: Git checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event.inputs.branch }}
|
||||
|
||||
- name: Set up JDK
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
cache: 'maven'
|
||||
|
||||
- name: Configure Git User
|
||||
run: |
|
||||
git config user.email "actions@github.com"
|
||||
git config user.name "GitHub Actions"
|
||||
|
||||
- name: Maven Package
|
||||
run: mvn package -B -s .maven_settings.xml -DreleaseVersion=${{ github.event.inputs.tag }} -Darguments="-Dmaven.deploy.skip=true -Dmaven.test.skip=true -Dmaven.javadoc.skip=true"
|
||||
env:
|
||||
GITHUB_ACTOR: ${{ github.actor }}
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
grimsi/gameyfin
|
||||
tags: |
|
||||
type=semver,pattern={{version}},value=${{ github.event.inputs.tag }}
|
||||
type=semver,pattern={{major}}.{{minor}},value=${{ github.event.inputs.tag }}
|
||||
type=semver,pattern={{major}},value=${{ github.event.inputs.tag }}
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Cache Docker layers
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: /tmp/.buildx-cache
|
||||
key: ${{ runner.os }}-buildx-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-buildx-
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
file: ./docker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
||||
|
||||
- # Temp fix
|
||||
# https://github.com/docker/build-push-action/issues/252
|
||||
# https://github.com/moby/buildkit/issues/1896
|
||||
name: Move Docker cache (temp fix)
|
||||
run: |
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
|
||||
@@ -98,6 +98,7 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
file: ./docker/Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<java.version>18</java.version>
|
||||
<java.version>21</java.version>
|
||||
|
||||
<springdoc-openapi-ui.version>1.7.0</springdoc-openapi-ui.version>
|
||||
<resilience4j.version>2.1.0</resilience4j.version>
|
||||
|
||||
@@ -6,6 +6,8 @@ import java.util.List;
|
||||
|
||||
// see https://stackoverflow.com/questions/26699385/spring-boot-yaml-configuration-for-a-list-of-strings
|
||||
@ConfigurationProperties("gameyfin")
|
||||
// Technically SonarQube is correct, but I like to keep the lowercase method names since it correlates better with the config keys
|
||||
@SuppressWarnings("java:S3010")
|
||||
public record GameyfinProperties(
|
||||
folders folders,
|
||||
List<String> fileExtensions,
|
||||
|
||||
@@ -2,7 +2,6 @@ package de.grimsi.gameyfin.util;
|
||||
|
||||
import de.grimsi.gameyfin.config.properties.GameyfinProperties;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.nio.file.Files;
|
||||
@@ -18,8 +17,14 @@ public class FilenameUtil {
|
||||
private static List<String> possibleGameFileSuffixes;
|
||||
// matches v1.1.1 v1.1 v1 version numbers
|
||||
private static final Pattern versionPattern = Pattern.compile("v(\\d+\\.)?(\\d+\\.)?(\\d+)");
|
||||
private static final Pattern trailingNoisePattern = Pattern.compile("( |\\(\\)|\\[\\]|[-_.])+$");
|
||||
private static final Pattern headingNoisePattern = Pattern.compile("^( |\\(\\)|\\[\\]|[-_.])+");
|
||||
|
||||
// Suppress SONAR detecting this as a potential stack overflow
|
||||
// SONAR is correct, but I honestly don't know how to fix it
|
||||
// Also it would require 6k+ character long filenames to really overflow the JVM stack
|
||||
@SuppressWarnings("java:S5998")
|
||||
private static final Pattern trailingNoisePattern = Pattern.compile("( |\\(\\)|\\[]|[-_.])+$");
|
||||
@SuppressWarnings("java:S5998")
|
||||
private static final Pattern headingNoisePattern = Pattern.compile("^( |\\(\\)|\\[]|[-_.])+");
|
||||
|
||||
public FilenameUtil(GameyfinProperties gameyfinProperties) {
|
||||
possibleGameFileExtensions = gameyfinProperties.fileExtensions();
|
||||
@@ -29,18 +34,11 @@ public class FilenameUtil {
|
||||
possibleGameFileSuffixes.sort((s1,s2) -> Integer.compare(s2.length(), s1.length()));
|
||||
}
|
||||
|
||||
@Value("${gameyfin.file-suffixes}")
|
||||
public void setPossibleGameFileSuffixes(List<String> possibleGameFileSuffixes) {
|
||||
// Sort in descending length, so for example "windows" gets checked before "win"
|
||||
possibleGameFileSuffixes.sort((s1,s2) -> Integer.compare(s2.length(), s1.length()));
|
||||
FilenameUtil.possibleGameFileSuffixes = possibleGameFileSuffixes;
|
||||
}
|
||||
|
||||
public static String getFilenameWithoutExtension(Path p) {
|
||||
|
||||
// If the path points to a folder, return the folder name
|
||||
// Folders like "Counter Strike 1.6" would otherwise be returned as "Counter Strike 1"
|
||||
if(Files.isDirectory(p)) return FilenameUtils.getName(p.toString());
|
||||
if (Files.isDirectory(p)) return FilenameUtils.getName(p.toString());
|
||||
|
||||
return FilenameUtils.getBaseName(p.toString());
|
||||
}
|
||||
@@ -68,7 +66,7 @@ public class FilenameUtil {
|
||||
|
||||
public static String removePattern(String string, Pattern pattern) {
|
||||
Matcher matcher = pattern.matcher(string);
|
||||
if(matcher.find()) {
|
||||
if (matcher.find()) {
|
||||
return matcher.replaceAll("");
|
||||
}
|
||||
return string;
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "1.4.0-SNAPSHOT",
|
||||
"version": "1.4.2-SNAPSHOT",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "frontend",
|
||||
"version": "1.4.0-SNAPSHOT",
|
||||
"version": "1.4.2-SNAPSHOT",
|
||||
"dependencies": {
|
||||
"@angular/animations": "^16.2.8",
|
||||
"@angular/cdk": "^16.2.7",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "frontend",
|
||||
"version": "1.4.0-SNAPSHOT",
|
||||
"version": "1.4.2-SNAPSHOT",
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve",
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@
|
||||
<goal>install-node-and-npm</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<nodeVersion>v18.18.0</nodeVersion>
|
||||
<nodeVersion>v20.8.1</nodeVersion>
|
||||
</configuration>
|
||||
</execution>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user