Skip to content

Commit

Permalink
Upgrade Gradle, Java & Dependencies (#850)
Browse files Browse the repository at this point in the history
* Upgrade gradle to 7.5.1

* Use LinkedBlockingQueue instead of self fiddeld list thing for filmlist import

* Upgrade to Gradle 7.5

* Upgrade dependencies

* Fix flaky test

* Remove not needed nightly action & upgrade java in gradle action

* Add new release action which publishes docker container & creates GitHub release

* Fix flaky test

* Change release pipeline to run only on tag

* Make assertj calls better

* gitignore angepasst

---------

Co-authored-by: Nicklas Wiegandt <nicklas.wiegandt@adesso.de>
Co-authored-by: Alexander F <alex@elaon.de>
  • Loading branch information
3 people authored Aug 6, 2023
1 parent 93b673b commit 1c8c81c
Show file tree
Hide file tree
Showing 15 changed files with 396 additions and 457 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17
java-package: jdk+fx
- name: Build and test with gradle
run: ./gradlew check developTest build
Expand Down
37 changes: 0 additions & 37 deletions .github/workflows/nightly.yml

This file was deleted.

45 changes: 34 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,53 @@ name: Release
on:
push:
tags:
- '*'
- "*"

jobs:
build:
release:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17
java-package: jdk+fx
- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build and test
run: ./gradlew check developTest build
- name: Publish to the Maven Central Repository
run: ./gradlew release -PSONATYPE_USERNAME=${{ secrets.OSSRH_USERNAME }} -PSONATYPE_PASSWORD=${{ secrets.OSSRH_TOKEN }}

- name: SonarCloud Scan
run: ./gradlew sonarqube -Dsonar.projectKey=mediathekview_MServer -Dsonar.organization=mediathekview -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN
env:
ORG_GRADLE_PROJECT_signingKeyId: CE3BA5E0
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }}
- name: Build and deploy docker
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

- name: Publish docker container
run: |
export VERSION=$(find . -name "MServer-*.tar.gz" | sed "s/.*MServer-\(.*\).tar.gz/\1/")
docker build . -t mediathekview/mserver:$VERSION -t mediathekview/mserver:latest --build-arg VERSION=$VERSION
echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push mediathekview/mserver
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

- name: Publish GitHub Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
files: |
LICENSE.md
build/libs/*.jar
build/distributions/*
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,11 @@ logs/
/.checkstyle

ui/

# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

devenv/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ git clone https://github.com/mediathekview/Mlib.git
## Bauen und starten an der Kommandozeile
```bash
cd MServer
./gradlew run
./gradlew start
```

## Einstellungen
Expand Down
Loading

0 comments on commit 1c8c81c

Please sign in to comment.