diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f63c29..fd19a95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,29 +6,43 @@ on: - master pull_request: types: [opened, synchronize, reopened] + workflow_dispatch: jobs: build: name: Build, Test & Scan runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 + if: "!contains(github.event.head_commit.message, '[ci skip]')" + steps: + - name: Git checkout + uses: actions/checkout@v3 + - name: Set up JDK uses: actions/setup-java@v3 with: java-version: '18' distribution: 'temurin' cache: 'maven' + + - name: Extract Maven project version + id: project + run: echo "GAMEYFIN_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT + + - name: Show extracted Maven project version + run: echo "${{ steps.project.outputs.GAMEYFIN_VERSION }}" + - name: Maven build run: mvn --batch-mode --update-snapshots package + - name: SonarQube scan uses: kitabisa/sonarqube-action@v1.2.0 with: - host: ${{ secrets.SONARQUBE_HOST }} + host: https://sonarqube.grimsi.de login: ${{ secrets.SONARQUBE_TOKEN }} - projectKey: ${{ secrets.SONARQUBE_PROJECTKEY }} + projectKey: grimsi_gameyfin_AYPM67pzsxiaNzCh9BZd + - name: Upload build artifact uses: actions/upload-artifact@v3 with: - name: backend + name: gameyfin-${{ steps.project.outputs.GAMEYFIN_VERSION }}.jar path: backend/target/gameyfin-*.jar diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..11002f4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,65 @@ +name: Gameyfin Release + +on: + workflow_dispatch: + inputs: + branch: + description: "The branch to checkout when cutting the release." + required: true + default: "main" + releaseVersion: + description: "Default version to use when preparing a release." + required: true + default: "X.Y.Z" + developmentVersion: + description: "Default version to use for new local working copy." + required: true + default: "X.Y.Z-SNAPSHOT" + +jobs: + release: + runs-on: ubuntu-latest + name: Release + steps: + - name: Git checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.event.inputs.branch }} + + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: '18' + distribution: 'temurin' + cache: 'maven' + + - name: Maven build + run: mvn --batch-mode --update-snapshots package -Dmaven.test.skip=true + + - name: Configure Git User + run: | + git config user.email "actions@github.com" + git config user.name "GitHub Actions" + + - name: Maven Release + run: mvn release:prepare release:perform -B -s .maven_settings.xml -DreleaseVersion=${{ github.event.inputs.releaseVersion }} -DdevelopmentVersion=${{ github.event.inputs.developmentVersion }} + env: + GITHUB_ACTOR: ${{ github.actor }} + GITHUB_TOKEN: ${{ github.token }} + + - name: Git tag + uses: mathieudutour/github-tag-action@v6.0 + with: + github_token: ${{ github.token }} + default_bump: false + custom_tag: ${{ github.event.inputs.releaseVersion }} + + - name: Github Release + uses: "marvinpinto/action-automatic-releases@v1.2.1" + with: + repo_token: ${{ github.token }} + prerelease: false + files: | + LICENSE.md + backend/target/gameyfin-*.jar + config/gameyfin.properties diff --git a/.maven_settings.xml b/.maven_settings.xml new file mode 100644 index 0000000..2d0b3b8 --- /dev/null +++ b/.maven_settings.xml @@ -0,0 +1,10 @@ + + + + + github + ${env.GITHUB_ACTOR} + ${env.GITHUB_TOKEN} + + + diff --git a/config/gameyfin.properties b/config/gameyfin.properties new file mode 100644 index 0000000..eeeae45 --- /dev/null +++ b/config/gameyfin.properties @@ -0,0 +1,19 @@ +# Uncomment if you want to change the port from 8080 +# server.port=8081 + +# Gameyfin admin interface username and password +gameyfin.user= +gameyfin.password= + +# Gameyfin source folders +gameyfin.sources= + +# Uncomment if you want to specify the Gameyfin database path (default is /.gameyfin/db) +# gameyfin.db= + +# Uncomment if you want to specify the Gameyfin cache path (default is /.gameyfin/cache) +# gameyfin.cache= + +# Your twitch client-id and client-secret +gameyfin.igdb.api.client-id= +gameyfin.igdb.api.client-secret= \ No newline at end of file diff --git a/pom.xml b/pom.xml index 5c05bff..6a952d1 100644 --- a/pom.xml +++ b/pom.xml @@ -1,25 +1,45 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - de.grimsi - gameyfin - 1.2.2-SNAPSHOT - gameyfin - gameyfin + de.grimsi + gameyfin + 1.2.2-SNAPSHOT + gameyfin + gameyfin - pom + pom - frontend + frontend backend - + - org.springframework.boot - spring-boot-starter-parent - 2.7.1 - - + org.springframework.boot + spring-boot-starter-parent + 2.7.1 + + + + + scm:git:https://github.com/grimsi/gameyfin.git + scm:git:https://github.com/grimsi/gameyfin.git + scm:git:https://github.com/grimsi/gameyfin.git + HEAD + + + + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + [ci skip] + + + + diff --git a/sonar-project.properties b/sonar-project.properties index efe7579..cb0b4b5 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,2 +1,4 @@ +sonar.projectKey=grimsi_gameyfin_AYPM67pzsxiaNzCh9BZd + # Point SONAR to the compiled Java classes sonar.java.binaries=./backend/target