This repository has been archived by the owner on Jul 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
169 lines (161 loc) · 5.24 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: Release
on:
push:
tags:
- '*'
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@v2
with:
distribution: 'temurin'
java-version: '16'
- 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 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Get version
run: echo "VERSION=$( ./mvnw help:evaluate -Dexpression=project.version -q -DforceStdout )" >> $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}}"
body_path: CHANGELOG.md
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