Skip to content

Nigthly release

Nigthly release #74

Workflow file for this run

name: Nigthly release
on:
schedule:
- cron: '0 0 * * *'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: develop
fetch-depth: 10
- uses: marceloprado/has-changed-path@v1
id: check-if-changed
with:
paths: .github/workflows src/ res/ pom.xml .install4j/ .mvn/
- name: Set up JDK 17
if: steps.check-if-changed.outputs.changed == 'true'
uses: actions/setup-java@v1
with:
java-version: 17
- name: Cache local Maven repository
if: steps.check-if-changed.outputs.changed == 'true'
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build and test with Maven
if: steps.check-if-changed.outputs.changed == 'true'
run: ./mvnw -B package
- uses: actions/upload-artifact@v2
with:
name: target
path: target/
- name: SonarCloud Scan
if: steps.check-if-changed.outputs.changed == 'true'
run: ./mvnw -B org.jacoco:jacoco-maven-plugin:prepare-agent sonar:sonar -Dsonar.projectKey=mediathekview_MediathekView -Dsonar.organization=mediathekview -Dsonar.host.url=https://sonarcloud.io -Dsonar.login=$SONAR_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
outputs:
haschanged: "${{steps.check-if-changed.outputs.changed}}"
build:
runs-on: ubuntu-latest
needs: test
if: needs.test.outputs.haschanged == 'true'
strategy:
matrix:
include:
- os: linux
architecture: 64bit
maven_profiles: "linux,64bit,install4j"
- os: arm
architecture: 32bit
maven_profiles: "arm,!64bit,32bit,install4j,!linux"
- os: windows
architecture: 64bit
maven_profiles: "windows,64bit,install4j,!linux"
- os: windows
architecture: 32bit
maven_profiles: "windows32,!64bit,32bit,install4j,!linux"
- os: macOS
architecture: 64bit
maven_profiles: "mac,!linux"
steps:
- uses: actions/checkout@v2
with:
ref: develop
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- uses: AdoptOpenJDK/install-jdk@v1
with:
version: '8'
targets: 'INSTALL4J_JAVA_HOME'
- name: Download install4j
uses: wei/curl@v1
with:
args: -fsSL 'https://download-gcdn.ej-technologies.com/install4j/install4j_unix_9_0_5.tar.gz' --output install4j.tar.gz
- name: Extract install4j
run: tar -zxvf install4j.tar.gz
- 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: Add install4j license
run: ./mvnw clean install4j:install-license -Pinstall4j
env:
LICENSE_KEY_9: ${{ secrets.LICENSE_KEY_9 }}
- uses: actions/download-artifact@v2
with:
name: target
- name: Building ${{ matrix.os }} ${{ matrix.architecture }} with Maven
run: ./mvnw -B package -P${{ matrix.maven_profiles }} -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
- name: Building AppImage
if: matrix.os == 'linux'
run: scripte/appimage.sh
- uses: actions/upload-artifact@v2
with:
name: release-target
path: |
target/media/
target/*.AppImage
# publish:
# runs-on: ubuntu-latest
# needs: [build,test]
# if: needs.test.outputs.haschanged == 'true'
# steps:
# - uses: actions/checkout@v2
# with:
# ref: develop
# - name: Set up JDK 15
# uses: actions/setup-java@v1
# with:
# java-version: 15
# - name: Get version
# run: echo "VERSION=$( ./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout )" >> $GITHUB_ENV
# - name: Set current date
# run: echo "NOW=$(date +'%Y-%m-%dT%H:%M:%S')" >> $GITHUB_ENV
#
# - uses: actions/download-artifact@v2
# with:
# name: release-target
# - uses: actions/upload-artifact@v2
# with:
# name: release-artifacts
# path: |
# media/*.zip
# media/*.gz
# *.AppImage
# media/MediathekView*.exe
# media/*.deb
# media/*.rpm
# media/MediathekView*.sh
# - run: echo "${{env.VERSION}}_${{env.NOW}}"
# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# name: "${{env.VERSION}}_${{env.NOW}}"
# body_path: CHANGELOG.md
# prerelease: true
# draft: true
# tag_name: "${{env.VERSION}}_${{env.NOW}}"
# files: |
# media/*.zip
# media/*.gz
# *.AppImage
# media/MediathekView*.exe
# media/*.deb
# media/*.rpm
# media/MediathekView*.sh
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: Deleting build artifacts
# uses: geekyeggo/delete-artifact@v1
# with:
# name: |
# release-target
# target