Add release steps to CI pipeline

This commit is contained in:
Simon
2022-10-13 17:01:08 +02:00
committed by GitHub
parent 7582be7bc3
commit c6c17002d4
6 changed files with 150 additions and 20 deletions
+19 -5
View File
@@ -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
+65
View File
@@ -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
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>github</id>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>
</settings>
+19
View File
@@ -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=<your username here>
gameyfin.password=<your password here>
# Gameyfin source folders
gameyfin.sources=<comma-seperated list of root folders of your game libraries>
# Uncomment if you want to specify the Gameyfin database path (default is <game library root>/.gameyfin/db)
# gameyfin.db=<custom path to db file>
# Uncomment if you want to specify the Gameyfin cache path (default is <game library root>/.gameyfin/cache)
# gameyfin.cache=<custom path to cache folder>
# Your twitch client-id and client-secret
gameyfin.igdb.api.client-id=<your twitch client-id here>
gameyfin.igdb.api.client-secret=<your twitch client-secret here>
+35 -15
View File
@@ -1,25 +1,45 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>de.grimsi</groupId>
<artifactId>gameyfin</artifactId>
<version>1.2.2-SNAPSHOT</version>
<name>gameyfin</name>
<description>gameyfin</description>
<groupId>de.grimsi</groupId>
<artifactId>gameyfin</artifactId>
<version>1.2.2-SNAPSHOT</version>
<name>gameyfin</name>
<description>gameyfin</description>
<packaging>pom</packaging>
<packaging>pom</packaging>
<modules>
<module>frontend</module>
<module>frontend</module>
<module>backend</module>
</modules>
</modules>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.1</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<scm>
<connection>scm:git:https://github.com/grimsi/gameyfin.git</connection>
<url>scm:git:https://github.com/grimsi/gameyfin.git</url>
<developerConnection>scm:git:https://github.com/grimsi/gameyfin.git</developerConnection>
<tag>HEAD</tag>
</scm>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<scmCommentPrefix>[ci skip]</scmCommentPrefix>
</configuration>
</plugin>
</plugins>
</build>
</project>
+2
View File
@@ -1,2 +1,4 @@
sonar.projectKey=grimsi_gameyfin_AYPM67pzsxiaNzCh9BZd
# Point SONAR to the compiled Java classes
sonar.java.binaries=./backend/target